From patchwork Wed Mar 8 20:51:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9611969 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 4B5986016C for ; Wed, 8 Mar 2017 21:24:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 346902863E for ; Wed, 8 Mar 2017 21:24:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2820A28640; Wed, 8 Mar 2017 21:24:15 +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=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham 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 5A4CA2863E for ; Wed, 8 Mar 2017 21:24:13 +0000 (UTC) Received: from localhost ([::1]:58505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clj48-0004id-A1 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Mar 2017 16:24:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clj3v-0004iL-8C for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:24:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clj3r-000558-9e for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:23:59 -0500 Received: from mail-sn1nam01on0075.outbound.protection.outlook.com ([104.47.32.75]:17117 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 1clj3q-00054v-NP for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:23:55 -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=Vzg4unss2llM73pAftoI4BGjN1zCyZqUmfVr+E5dzf0=; b=Q60Q8njTX+Q3xQanTmBkdVuUbl4WR6pEx/Ro2JkJPZrKgz4IT8q8cvHFN5cxrGe6Bn3SbHaKsI++nJSZAzMa+IexpxuKXK7ik07nLrN8vLdHQ0lQ8eV5VrY3DiRHdgF1N6VE2tfN94qpVU8H3wJTcAcukHLXXbf0fapjgKtz8xo= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from [127.0.1.1] (165.204.77.1) by MWHPR12MB1616.namprd12.prod.outlook.com (10.172.56.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Wed, 8 Mar 2017 20:51:31 +0000 From: Brijesh Singh To: , , , , , , , , Date: Wed, 8 Mar 2017 15:51:28 -0500 Message-ID: <148900628810.27090.3461280348833651824.stgit@brijesh-build-machine> In-Reply-To: <148900626714.27090.1616990932333159904.stgit@brijesh-build-machine> References: <148900626714.27090.1616990932333159904.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR17CA0035.namprd17.prod.outlook.com (10.175.189.21) To MWHPR12MB1616.namprd12.prod.outlook.com (10.172.56.17) X-MS-Office365-Filtering-Correlation-Id: 157a636e-791f-4596-4832-08d46664e7ab X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:MWHPR12MB1616; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1616; 3:K9EQsD8jkjRy0ZMdY/YBxeC4ZGrhxCvjTbJQNtJhE4NXW9uHKbBy1asZytWpaGFUIhGjWuzAWZ0IyZRtEOC4392h3cxenOJoYLxfArcMJ30/3Dj5DQGlGqNdAP5PZKhmpL3uZkGa+Qv2l9WnUX7kbtDjhbEKkIbOw1eZ7GmuY0rjfye5Wd1A/Aq4fDXqFYdEUxr//4WbxfVpYYxwLDxsV5L9n+rdOlaW2kvQLbjXd2eJ+3VCPcaqRA8RSDmWQJMP/SDfdww8J5zsuyjzbXMDnEbh1Bi4BIP0pZMgnPhQn8A=; 25:1qTYWMrmpSiq3y0pd5Fgv+1reojfIG412GtwqJsoZ5FjIEULWhVxOU+AljpyaS6H6iNg+K+i5D/UsIIPoiQJXPGXzsNaQmESLoRfb3sLdROOQdIR1RyweTiffoDDRfYylEPm0p4It0U4Fbi3zlZvWUxHZ0WOinEPc4PJBzq6yvFqZ08rImJ25TqhSRJd3VI8wc8oO36dzDFC62NfMq/9DjQTMgaJnhsUrDHjPlFWhMe/wp6zbmCAHPm/ZbNFlhMeDjR3e4T2L/vxUVmVGSM3kgge390BlwJ7K11J7oI7G8lqb7JyTbd84nGL8TxjB/LrcLw72k1bMq0R+ubA5caQ+ApNzm3lCvW/a0qxCtOZp1K5Ul90UdVflAO9oKHBNO7JAIto8yxLJrOzq7nT3XMdBhghh0PdM3rgYNKQ64HxzisJym3Wt/SU7SyEcXfgMSdn X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1616; 31:Yo5V++GY2s69R/hx6v5YVrrepJJcktsBP8Q5mqk83us67cH3PtPtEzkeVLQt/h1H3Rq6ugXi5LPId3X8xBzC5F3QWUr6cdvKTNGXs5mUU+Rc4UWV16iTW1B48JCQkwO4cCIiK36QxFpl37K+Qdfl3B535PSof3FHs9q5dbTZ1nKKb9JYoPJBHlCAEtu5Pmz8estCNu9k+OzcOzP7gUCMCw9mZn6B8WdXmEqd/fcI+Zc=; 20:LSx+k5xJdT64UTgBpIfikrPvN226Z+kX51y5Wo3c1wnB/FSK+J1EYkqwxt+kLRGd2fj/MGm1Z4SN/oY+7sFVaQMkUrCTQz/JIU3UFLAM/Dzou7+vNWRL/HE1jSc0pOV/G/3Y3hZUPn1WX8mthUUkMZ12miGsc0UGcGO1nKicckIBaQlvo2gaMKndLUS57SJvZfslQdG6xqSguNgtONTd2kVMYKTxMKbn5W0pMnD173pDkl8Xx+KrVJHK4ed/jkQOZSBJUY+a8/T9n9L11pgVr2tuLRhzvtPC82lFe1AOaHKkJAajFARDNNmrtCvTfBx1B1mehBbaHYnU4A34N0MyvxuDVD24NDQ9xdiTiSCc9/eAh3Jp2yBQvuO1I96BBg4C3TK/gjzpjCUCjeC5oCFl95pfBwUAJry3MzhI0aQgFAERdyEpxpU9Sq4ah4Qew06542dgbXa5jHjVEMHt1L7uylnkq3t6Lmq6h8fHO8l2/AaZnTzhvh9L5OD+WrwVB5/5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:MWHPR12MB1616; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1616; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1616; 4:pCgbjB33tDDxtjatNpq8EPqzLgYEzmfyD1kltKdn4bzen+fzbK7vhJ4+WGIeIUzCw036FwCdODIsYASPECmDcpJayEi8Hgf1mtMNjXb8gADp0UGIRy01oV3itHJUbAPDUN+AJ9GcG/ra/ID9tiXbZXnmcKmcdZCpcskbyn65AwgJg/CCF1eDDIx9JwBWucv5Y/2b+Qj657tGOmf/qovGjXNVxzAljMp2JBBb6X9pc/RgnKVebE6Sy6fXn8bffHT4xhM+V5AavIvl5k+EyLRh5eqhkW9rGXKR9MajcMM2GkUGJhdu9T/LSsxGzDPXFNfQU0oTdCyGlk13frMWwN1Xc6haIHIdjBUQ8hDU6jVpzzp1+2cEIbFsNaycg/2znaEs+qt4e26EhYN03j+tAVPp/85gZyf1RqoebjkauFHGXy4nVhwm1IMBw+ppLvylPLYpVHktRy08IDVFokcEbUevqcWgVfC/qBUlG3zmx7ujdAKJSCIrazg+TBQG3Nqc21x2izulfM7PwPruPS2Zu9jhe6PxybPdMJtGa5zRSLdOln6kaNrQrG8tR61qgGaZ8ckmxNj4KJuPya3dppQL3CvTwIJqOiLfxoDBTBpNSmL/mc45WNaBGwNo8yL7l8T7YOaDxRe8XJKhrFD5AYcbIOUEUCu4P8szp23tOWyTKQXeJl0= X-Forefront-PRVS: 02408926C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(39840400002)(39410400002)(39860400002)(39850400002)(39450400003)(86362001)(5660300001)(2201001)(33716001)(3846002)(54906002)(103116003)(4326008)(305945005)(189998001)(53936002)(9686003)(38730400002)(7736002)(6486002)(77096006)(90366009)(6116002)(230700001)(25786008)(50466002)(33646002)(81166006)(76176999)(42186005)(66066001)(8676002)(6666003)(23676002)(83506001)(47776003)(54356999)(2906002)(2950100002)(50986999)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1616; H:[127.0.1.1]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxNjE2OzIzOmE3S1JnclhDajBIOWFPdkc0WEsyUngwemlC?= =?utf-8?B?d2pxUDhJdVlWcUJGRXJ1Rjg1U2UvQUZyVXZxeUsrdUxxc2Q1QmFrNExwUmZW?= =?utf-8?B?cENsMGpxV2pPSjdqZm5Pc3BkTVB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IxfyTAEIGvdihEJHBt0xjFZRdZDQXlm1ST63gVXwqt8tZgeevfBJWH4I5WcZxYjgyRvS/Y77MHs2dERh4eVcHFF+osOgAO8yMddACfqg9u6muXkyJrRQMq845EujWi558HT0YXtbjYAe5MH7ljLazz8avA3s8m7orKlY=; 24:h3KI1QRxhKlbjrlTem+BD0WBKupCt9wFWqZLvuo9NxVECVIBPaey+OYT6btO9gAtuzn33WL1LjAKZbex+/rV1KX00IoGoaVNY7ljFRDfrQQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1616; 7:Jpr8oQJiXg+x9/imSJz307c+QRds6NY/ktisSwJxeeFD3xJ+3QNsDNpZ7XmW66p17q7rjFnM9dKJDsRNk1nkuVkVILU9JHJfD092kxvrBbazvE6coWM+4IzFZ9lswIW+la3/DXSCVtYuSF6rIiXgduPsUTyYzjCYDfoEy+a70dyMbYXEXUcQtCHm2r1KjxErj6ruNxEUUy5ZcjIUlivgWKPzO8Yo+PNjaXsXrxdGyVCMmo410G1JzHM++8mF2bt2px64ONW8dYoNxm7sb2Q5/a5AuBhYC57m4ajTz3YzwYmNZj9TSZHH54xYxTv1tP4C1ZNoQqlFHQQ5kJ0QfZGbgw==; 20:Y97FM4FjxaxsgiMGCyyMzcplXos3aJ0f+SDNLwPM9xbLk/Tl0UYHc8eGff++j1FtqCrd6rx4w/TiOyGe0lWVPvFwZ855BvrhUz/ro8K3fAgKCOHc358EVhNkKt0lpT3tm6CGKdrz2PiW7yElQdj4j6U7l5Td4M3wgNxGgwyj1hUJIowGTlmI9GNDbC6iC7ysWW2UStYG6x9UdSdU1ZwwuZLmUxpVJbAuIlYZscD8RmOmI4gUy3cQ27Z8DVTbRkb2 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2017 20:51:31.9824 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1616 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.75 Subject: [Qemu-devel] [RFC PATCH v4 02/20] 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: Thomas.Lendacky@amd.com, brijesh.singh@amd.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add a new debug attribute, the attribute should be set when guest memory accesses are performed for debug purposes. The attribute will be used in SEV guest, where we need to distinguish normal vs debug access to guest memory. In debug mode, we need to use SEV commands to access the guest memory. 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 e601061..b802073 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; + /* Memory access for debug purposes */ + unsigned int debug:1; } MemTxAttrs; /* Bus masters which don't specify any attributes will get this, @@ -46,4 +48,6 @@ typedef struct MemTxAttrs { */ #define MEMTXATTRS_UNSPECIFIED ((MemTxAttrs) { .unspecified = 1 }) +/* Access the guest memory for debug purposes */ +#define MEMTXATTRS_DEBUG ((MemTxAttrs) { .debug = 1 }) #endif