From patchwork Wed Mar 8 20:54:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9612007 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 DAD1E6016C for ; Wed, 8 Mar 2017 21:34:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCDD11FF8E for ; Wed, 8 Mar 2017 21:34:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFF26284B4; Wed, 8 Mar 2017 21:34:00 +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 8DCCA1FF8E for ; Wed, 8 Mar 2017 21:33:59 +0000 (UTC) Received: from localhost ([::1]:58550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cljDa-0003lo-Av for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Mar 2017 16:33:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1clj6t-0006uA-CH for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:27:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1clj6q-0005l8-7x for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:27:03 -0500 Received: from mail-bl2nam02on0087.outbound.protection.outlook.com ([104.47.38.87]:47277 helo=NAM02-BL2-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 1clj6q-0005kz-07 for qemu-devel@nongnu.org; Wed, 08 Mar 2017 16:27:00 -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=d6fpIKQoZetxJWGyXuDozDbrXk/Cc5uBE2Z/63p5Pyo=; b=YF7Vg4Y4L3NY8AfzgOTglbqC9cPbTR6tO7MK4nBjBVC1t5Jdd5mvGXyFcNRm3kAKrbXD++m7uq9Zd1iFjj38aTWMT8sjFU2ghEUvRW5f8uf0QXtimnbdrtaui8TTe8FBSoUZHuYLjYYjj8EZ7DBxPHxu3I5PlXJy52u5EJJvyJs= 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 MWHPR12MB1615.namprd12.prod.outlook.com (10.172.56.16) 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:54:23 +0000 From: Brijesh Singh To: , , , , , , , , Date: Wed, 8 Mar 2017 15:54:20 -0500 Message-ID: <148900646027.27090.10825101032119361281.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: DM5PR15CA0013.namprd15.prod.outlook.com (10.173.207.151) To MWHPR12MB1615.namprd12.prod.outlook.com (10.172.56.16) X-MS-Office365-Filtering-Correlation-Id: e6d4d381-073d-446a-40c9-08d466654d3e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:MWHPR12MB1615; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1615; 3:yp20jRNE0bA1+Vma8lFwVqJ/lBdPwJNOYBZU9i1lJ0P+B/ceCxAGsnSiA9v/kAGJhcSXu3ofkIEVEsyYqKIKga0/BMiGB1tlZVCeEb2G9g5VXfAfmi7fV2ncKnHV+foRer/Kl5hEQdphvw1p5mngxjBa7v1RELqFnjH+EGV6DgD7XNnCMGKIiiIRDCwtE4KYVhCfyCet6kix6xfcp4PvDJujsePp7YYWX/8dz4DXEmQa19it0rn0Om4mv+FXWMeoTRWDInjrX/GofYzwToqAq9wUD8jWf1y9M+b12NymRCA=; 25:pHPwE7+xV6DuSwGEOFZsEr24iAADMC9EJhjECf1RJr6SuvKB+3HmEWICkYprRlbjhUbAbDb3tT5VDpbqMljnFnzTGeCvbPnOy1duCuXq6Ld1rz/Y1Nmg8C6niMl2D2BedVJ6/jAoggGx+OHMH+xWCmHsz+YSw6Qd1pWR9m5cQ9lsBaUyT5obhScWHObPPrM9CT4OLZp96VjyRXaUBlGieYHs22vHwlgg63lfpOtXThkHxjwXTfSwJctrkmatoV+1ixP26mBPWA90SJA15o68wm3VyPtSztMITE1nofoTLH6VmuyiE6SWP5U609ZqGSqKAZQ2pgzgGlFm+CE6NZMi+opSN/lHS95n22wQlsh151rn8Ar2WjjuLYrMc9Ee3/GIZIWcVN1+8ysnLAz9mBu/N55vL6DoLvRGEwzWn6j3St4mf9esjglEtb4Bw93+LVPh5EQiOf2/upmpeKdQm/NhGQ== X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1615; 31:Y8nhejDfmQWE33miPWDMLlQDT46DRLiAwiHwsFX3i/x2VnjU8VBGyaX198xWAi9PWzujol92MjH+TVvcJfIRu2ld1X5nsIaJbr54D58NOEYW+87hTaxMMisFBgwj22ETZ3docCbu8nU1EM3o7WbdqOK3+TdQeLZMiAc5DJYacXpCUonJdAwcumHzbcbHC55G0YklYaMeVT//DLmwGvzIaY6u07ZIA09fHjkQCX+sOoDr1ewqCXDJp/H8KsfAvhA8; 20:+EOPHMlQY1ddGlBFW5lm9Jbxy0TPaV6/uo8afocSLLj3cGyONOvVccW7zI/+SjIFoVc8xA39u7WxM7NpXAlXwe9ZLwPMKWjjPUejGoMKAppqZncjXp/+sK/oy6gD0K3wzgEOjKHJA9XLt6s3JnV3tOeqLgz6mRxjf33KsXD0wPXUOibDPq5sMN1mrmM7yylKzDFDiah73yGK2Ay8bYjySHxDXifdRCuJ/opvCJBrUJGMGY3k831WlPA7MNOOI8Q5SiGrXmVaJ/J+6+FxLMLBWMSxI3lDTOsSm1QJy3i/ehg7LOuMGlNeS2SGKz75b32Ioj7SRCQjY12fmtP+ISBvXL/DviMhWQZn7mHwBm5fJjQz/lMJfFWISj0FqMZoAkiyNBgiU9DbDFmvsBfWklIlrwPrlaqLdR1/VYHxnFerO8ugPhXlCmT4bQH1DNzvrVaSfuS+7BSNlGFHyTI6BSrdRPUDeoAq8o/4pt1bIhiJfnbvxKIjLrBh+RgxFghriX/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)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(6072148); SRVR:MWHPR12MB1615; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1615; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1615; 4:R4LqBbYwOZ1hX9diHT+XoKUb14Vopn2nf4m0TTBR77Xl/M1weY561oVyBCX3ROYbINELDOjLMULrwVb/gFS/VWNDePhGryL2aiuLPim+pU7vMnDqOZyitwzSMQnDZ60OhthxELK3QJLD8mrkTsxVIgtHDdRk7BUJDuF7wUwK9r9Z1a2pPDgrDbxK9+Hb5JcUzDJ2JNdgSWzwFgbVsPwws4W4795jctTfAsS+DX256lT/dxVL0KFUNiJtdgzhWvcT06D9WW1dETU2ZqeZZbH3NRkydgs6JPnAW9fifCOhnZQdHNNmuy2v3Ove+Phx4NCiFUu0S0vzurxDtKW/qS964AVxUlbufzr8QJ3OxsENWp4uQ5qQJvVWK9t2I2Vf/Gi2VKMUoQQbLXIz7Lf2jPvfEYAJmn9dMEE3GE1FJj9Hjag+NzGav6FPdgr1gRmL5oXcEgKBZpEOpQEeW/dL8S69CWS9MhTrRc/SSrCXQPRvxAhEfWgnQbO8VPUW6gftnnJG6NPJ2/UxDOd5dpbe0KZ/yDp41G0aX+fbBgNl0PKTd90WaQdYV35N71Jj82egUdMaHomKRZYcnHD2/UunK5qsnNWdx0BtMQr3U76CK7Paih1fhTlbsOw4VqcNVurLwRp0B3gwTH5ofw2VXTbm9R1JSap4vDCBoBMqClQepoFdZI0= X-Forefront-PRVS: 02408926C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6049001)(6009001)(39840400002)(39860400002)(39850400002)(39410400002)(39450400003)(189998001)(66066001)(33646002)(47776003)(54906002)(50986999)(2201001)(86362001)(25786008)(81166006)(83506001)(8676002)(76176999)(9686003)(50466002)(3846002)(5660300001)(2950100002)(90366009)(54356999)(230700001)(42186005)(53936002)(38730400002)(33716001)(2906002)(7736002)(305945005)(6486002)(77096006)(103116003)(23676002)(4326008)(6116002)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1615; H:[127.0.1.1]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxNjE1OzIzOkFjQWIxWFhPc1BTQkVLQzF3ejV0aWp4THZV?= =?utf-8?B?bHQxbXIwMGdtbzNCV0UvRU1Gejk2enRtYjBLMUYra1VtSGRHNzhwYldGN0FX?= =?utf-8?B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/ZXG8CLaD1gfZ0UJrLaR8Vf4ZPXbwIe3gj2DN4qKv9nzHXQSCkCk7telbRDizt9G8qgN6yNxBy4SExzLcpHYqu09pgyqpzGoh6J6MHg49Zzd35a/RL88VxmEwQ/3znD6Dh+VoTD9p+GA=; 24:jx7TZP0Ez4JyfXKgbxN+6wX0qoarWkW8ekZeoFXyEBI/IrFeSBmltUhTbJC+BG06gSTyhZsG0x42Amjf0tcA5QdvQTgqBqtiyuI8I2LWHLk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1615; 7:WJSqK2U9gLOJw1G847ZAzuOmUt0c272xiF/QtayJXMJGnV6wLBqf9NGjR1i95httN3XYe0uq/lfSYRS7bC6h4F0lJ/mOdtx6PnAkO00OTfLrIvdv7ugUj9Dg0G3schyi3p7Y9G/oQXsHqARP1Cwe8FcctXkMI6aFkPspngXTERfXzJZ1aDWflGKVVz4ogy3MX/CYa2U13YwMaA2mZbJqs4x9arsgC2T1bVOc1vvHxsphoXcQMEZAXGu14xg715tsaWnLvovIzbH+hXUKb/VxzpMRxpC20cnOb4hoOKrCaAjt3HdbdOueNl4XZlOr0BMogQFbs+5EAzhNnckbYFIz3g==; 20:t8fSB6zxOd6VEGdveBkSjJAbyraRjOCnj3qLfsXA5dPPs3x7U8b6toFTr6DYY/1iHdx8VsbnT//i9aQIrwEJdvFALYEhLKP4h5PCcEwSiN6WpsJEtb9jbx+jh/2a18btnauLtDY4jclPzck3Cpv86wk9lXtjtoW8X/AfSJOKjcIVYPesa7KLA/eRWWcHtxZwJ6L8ppl+4cgujRmMeM0BVAdCGsFB89G8AVVDApuQfMat4AGzcN6UIjsNODPocO1e X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2017 20:54:23.2393 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1615 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.87 Subject: [Qemu-devel] [RFC PATCH v4 18/20] target/i386: add cpuid Fn8000_001f 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 Fn8000_001f cpuid provides the memory encryption (aka C-bit) location in a page table for the SEV-enabled guest. Signed-off-by: Brijesh Singh --- target/i386/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index fba9212..44662eb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -40,6 +40,7 @@ #include "qapi/visitor.h" #include "qom/qom-qobject.h" #include "sysemu/arch_init.h" +#include "sysemu/sev.h" #if defined(CONFIG_KVM) #include @@ -2966,6 +2967,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *edx = 0; } break; + case 0x8000001F: + if (sev_enabled()) { + host_cpuid(index, 0, eax, ebx, ecx, edx); + } + break; case 0xC0000000: *eax = env->cpuid_xlevel2; *ebx = 0;