From patchwork Wed Dec 6 20:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 10097091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 75BED60210 for ; Wed, 6 Dec 2017 20:14:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 676332A039 for ; Wed, 6 Dec 2017 20:14:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AA522A03C; Wed, 6 Dec 2017 20:14:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4E7482A039 for ; Wed, 6 Dec 2017 20:14:16 +0000 (UTC) Received: from localhost ([::1]:57562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMg59-00012j-Cm for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Dec 2017 15:14:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMfvX-0005fj-EZ for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMfvU-0002Lz-81 for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:19 -0500 Received: from mail-sn1nam01on0071.outbound.protection.outlook.com ([104.47.32.71]:52950 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eMfvU-0002Lp-0c for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Q8Hw83gf7H9EmKYA5ZPgh/lOGLqHVBKjBRxbfTZwH7c=; b=y9skui574kQqlJBa71L/9dWLnfbVBdrjKJWOnD7UjdN8Cy1KU0yQoDlB8d1RviQEW1kT1Q818iXSko6nQzipQhPRTdhW7eZNGQZk8IbBRDmIeGdmYW0pc5Pc9jvII14sNPtGXuk+7oeXrpUlmg1KwnFZPNuWc231c8KsUMR3Wi4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from wsp141597wss.amd.com (165.204.78.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Wed, 6 Dec 2017 20:04:10 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 6 Dec 2017 14:03:24 -0600 Message-Id: <20171206200346.116537-2-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171206200346.116537-1-brijesh.singh@amd.com> References: <20171206200346.116537-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: BN6PR14CA0035.namprd14.prod.outlook.com (10.171.172.149) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: df01fa6b-895c-41f8-8c03-08d53ce48505 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603286); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:wTdW7Niot++OwmWBrX2WsEPgKdaZt2DKdf0VxHOIIzNg2GN3DDSOzrepmFseRWmNyUj+/WxpK871fchboUEx9mD/s4FfU2if5eIQJ4Yx8+f5ytZR64Q5eOxyfA5v6k/te0r8jb/lZXFIqF8W2LCkbk8Ow2zKhqG3GZlQSirX95ZCp0qLym6XQR9/232Ulwxr6839jrCvfF4UgpcWKqFyrV12SegEVaDrTaUPy2qGhsDW+4m2g2Z98rsVbxX4OVDW; 25:QnyjhHWvpWxd75QnQcYbQJZ8dC5r/VAegZrJluy8F6cNXsLfD4MuJXowPKGao1ttP/DST6m4Itc+rMlrGlkC3mImn7QZNGpyR6kfiVIJKzE0CNuwDTPk2/Gk8cEm4UfJ9fNoSjGaUqZWp45u/2B94ZS7TvqjCF51xWmLwZ0bUHAeHnn8ak+MFt4CFSLLH+T2io8w3HVeCPikjwCKAcweZHijdCYXCcOrinM5s+SXaXcHxA8j+auWq/PpHeN4/Xgz6XO03Yq91YM8R+HLBft11KprX6AmUpNHDSGE0dNHrU8wSUSyBH6TgDcljM0rWzKQfD2BpPvEFkYGXPp9I3VYPw==; 31:/ttqMPleAnVUWPkWRXbhEvsnH7WpAxUflUok/vD5TkJSaEGDZt1ZiDAhC7sqCY+kbmlArnbpV3QJuOnZFZ2dQlbtHNF5onyZF59JmsSjblD0TjuDDiq+6o9Ve81kK0ayJRsGRwfCnX2m+l6qalrFlxVhd3Wrry7JhOC9PYkIRlNO3H4YlHV8h7zDhw4xbFdJM5FyhFrcAKhTkGS3RmSDGAcicNfwW2HfQU6dxXKtrqo= X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:xg/QqIMbS94Yq588Eg7or9fxWsk8jk4++bSCMbBvk+OhfcNxWTcHri7AIqnkBj9g33WLrwGTGwPhrH67W/P5dYynLVhyvp04W/H4BIbbtlQAPs44Dp2+qUFcwFedOTwhjYokBQENEAZqx12qrhzslaREbDUSz1of5t9Z8jJmpmIVj/t7UuvXNIirQP/kUOEbVcGDtOWOOXr3Tbte3+j5mfMQUrwxnn2elqZXHF0mrVoFCKSjxRRsXzbUkc+DPKv8UhnHgQLHRt0BjYcA2PQUidNCcG/E+KsyfHKevbRm3t5Of2/7VP6wB/hrh/R2Bag7J1awr46CjgqChmBVI5LcoSun7C12zIcHMdXp59FxBdGPS4wNDWeHqzk1yQ5oXxXcqRx9G/agQ7ZoDqO/aaCiY+IoNquXqIekfrso8vOhSSHYzXZvQZvri9+cUN0GyCqWE/Qwx+ZtUlKqwFCCswpIifZEz9yf9zlmxk+jpHqvOo9FZeafP1Ta0CK98kVlpRUC; 4:FRloA8qQollPeksTDPO3mEJYWNWP3c53lhK9y4LV11piqvbSlFRkGhiFlbTAyeH4SsdkmzMc9POlarJOg8at10rvo7mggScIfpnsuHquqY1ttgUoTXKST9fDV9c+OS07omdyyM/Gx0Rz8Un9uit2gMDlu4C1xo0N3WA6AUnUS+ECFwETTxqsu+60A73NeWUVE0QcEdPte0/oAr/qLA/+M97qSmq2p7rmAcwyhB8dM0IG6RErHziev3ykDiuJjbjhmtYjuk0VflTVxjcyDT3WR6MaeUlUjj4lFasxClixWcFLzLCksCs4IVYKQhbAfruHt0onQPF9iux9oiGIyyHQ+Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231022)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(6072148)(201708071742011); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN1PR12MB0158; X-Forefront-PRVS: 05134F8B4F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(366004)(199004)(189003)(16526018)(16586007)(33646002)(53416004)(105586002)(39060400002)(4326008)(305945005)(2351001)(106356001)(2361001)(7736002)(7696005)(86362001)(52116002)(8936002)(316002)(53936002)(97736004)(76176011)(51416003)(36756003)(66066001)(1076002)(3846002)(25786009)(6116002)(47776003)(50226002)(68736007)(54906003)(6916009)(2950100002)(478600001)(6666003)(8666007)(5660300001)(8656006)(8676002)(101416001)(81156014)(81166006)(2906002)(7416002)(48376002)(6486002)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:wsp141597wss.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:S/r3oGGX/7JYJNfK/31UBSLjBnIx4Az3X5k7L8UlD?= =?us-ascii?Q?JuybrecZPhqclnE8n7+QFOWcfmLaKH1AvB2hjmC3DAZoJoUTIAgOc054S+sU?= =?us-ascii?Q?2lGY6rznrdlkNqg7f/Myo9obnVQCxLUZbPM2GItDutS8lvEG0cwxVdFYfzXf?= =?us-ascii?Q?0cStszFKmiyCtLM/E5WHX4ReXnfMwmAd1UnXHFJCip8jRyhx4mXiK+xfagOf?= =?us-ascii?Q?XyJST+AdfvgVRB1VVk0OvEyIZQzpNgBM3oqTZX0yV8R7BJaOtovKpW7eWICL?= =?us-ascii?Q?5O+yKZNk36FV0VuGDrRjOl0eD1Qgu0ridMv0Yao1AqqcjbeSC7R0a5SVfZZB?= =?us-ascii?Q?dGFnRr+2g/9tQ7xkbUnx6gPmUn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HnITktnpreq33sRsbtytzP+Z7UBMrAyUrUjVixyWBvAmuJ5nqyzrMQYbcSEefp8aS6NI6tKC7tHmvgGKzvcZXgKM8VeqxVwkBjugGhHJARWNhZi99ctIbGPisFlTHHElkSEawLH408WWXsZqqcG6eCAJyDlOV3Ei93ujZkq1Aezm81WXzSv7ODA5ahqTbZOD4csQRJ0HU6PMcma+KRj5yxT2JqjEQni+ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 20:04:10.7549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df01fa6b-895c-41f8-8c03-08d53ce48505 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.71 Subject: [Qemu-devel] [PATCH v5 01/23] memattrs: add debug attribute X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias " , Peter Maydell , Peter Crosthwaite , Eduardo Habkost , kvm@vger.kernel.org, Marcel Apfelbaum , Markus Armbruster , "Michael S. Tsirkin" , Richard Henderson , "Dr. David Alan Gilbert" , Alistair Francis , Christian Borntraeger , Brijesh Singh , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini , Thomas Lendacky , Borislav Petkov , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The debug attribute will be set when qemu attempts to access the guest memory for debug (e.g memory access from gdbstub, memory dump commands etc). When guest memory is encrypted, the debug access will need to go through the memory encryption APIs. Cc: Alistair Francis Cc: Peter Maydell Cc: Edgar E. Iglesias" Cc: Richard Henderson Cc: Paolo Bonzini Signed-off-by: Brijesh Singh --- include/exec/memattrs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index d4a16420984b..721362e06292 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -37,6 +37,8 @@ typedef struct MemTxAttrs { unsigned int user:1; /* Requester ID (for MSI for example) */ unsigned int requester_id:16; + /* Debug memory access for encrypted guest */ + unsigned int debug:1; } MemTxAttrs; /* Bus masters which don't specify any attributes will get this, @@ -56,4 +58,6 @@ typedef struct MemTxAttrs { #define MEMTX_DECODE_ERROR (1U << 1) /* nothing at that address */ typedef uint32_t MemTxResult; +/* Access the guest memory for debug purposes */ +#define MEMTXATTRS_DEBUG ((MemTxAttrs) { .debug = 1 }) #endif