From patchwork Thu Sep 22 14:54:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brijesh Singh X-Patchwork-Id: 9345537 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 0B6A1607D0 for ; Thu, 22 Sep 2016 15:22:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE532AB8E for ; Thu, 22 Sep 2016 15:22:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C8A2ABA9; Thu, 22 Sep 2016 15:22:43 +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 8DDC72AB8E for ; Thu, 22 Sep 2016 15:22:42 +0000 (UTC) Received: from localhost ([::1]:50342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn5ph-0005fa-K5 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Sep 2016 11:22:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn5OV-0002YZ-6U for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:54:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn5OQ-0008Q4-2C for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:54:34 -0400 Received: from mail-sn1nam01on0041.outbound.protection.outlook.com ([104.47.32.41]:49120 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn5OP-0008Ps-QK for qemu-devel@nongnu.org; Thu, 22 Sep 2016 10:54:29 -0400 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=eCQHa4o8zkbSYg3cZB6zkQS2N6Ius9zvrFsgTt0KoYA=; b=DZWm6pAQ5osx6m+XB5fhUkq8zto2CuwRlIWlLmhI2PVfJiZBnJgcafo2Mt6Kqp8QNIWX8TVVhF8/iWn2PI9S0V7sl5DUf9Wt6SDQ6UuUZlt8KUpayhFu+Zzkw6f166oW9XzUH6Ae2sex+i8wqe18nhsco9a9bdnyIri0u5USiyo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from [127.0.1.1] (165.204.77.1) by SN1PR12MB0672.namprd12.prod.outlook.com (10.163.208.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.629.8; Thu, 22 Sep 2016 14:54:27 +0000 From: Brijesh Singh To: , , , , , , , , Date: Thu, 22 Sep 2016 10:54:25 -0400 Message-ID: <147455606495.8519.8676724837911334309.stgit@brijesh-build-machine> In-Reply-To: <147455590865.8519.11191009507297313736.stgit@brijesh-build-machine> References: <147455590865.8519.11191009507297313736.stgit@brijesh-build-machine> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR17CA0018.namprd17.prod.outlook.com (10.169.33.156) To SN1PR12MB0672.namprd12.prod.outlook.com (10.163.208.30) X-MS-Office365-Filtering-Correlation-Id: 30f4182d-f7e1-46a7-ee7a-08d3e2f859e6 X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0672; 2:cyeibRJSGMpPuyqStXCuov64E29esM3Mm6fqra8TWln7WVxWUK85mn1eofihERtZBHOuLsQaEb8JH58yWYzL3bouV0adBS8/3CfcIECVHO+fsLQqy1CH6MxmCJmcNDWcsTwNgTPK4oQuLa8bCHYzoB2q64MbvUkjvHTJt7a4sZyyuKswxPLpDs8jAyMUDpvm; 3:0gXSISOzNxX91yQFnNLYP6QnpNenw6mbv/kZvOy8SkYg+SHD/YlTNnXC70YKTpuaRAgcHw61SLwdzRGx+H/SaV36pR2KFWZD+EHJ9hjKKc+IgEBp1XeynH0fEQ22lzvH X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0672; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0672; 25:lggymPclwT/RBdnXx1wc8SG7io4a2oHlQrQGm17EFdylxlY6q5SYnT1yZfR+9IKufvXZMUwLL2wv6uQkeeUaduVvOY9tbI3X6vEW2QQv9F+QQ/6QDycPM7Y0vegRqsxOAox9PUQmMoa1ordhSc+f8azETKhTLkbL5bHIFonxE/vbqbK5lXTGks6esa/ZRnMmcNiIBr7P++cwJTcPBtg4Sbk+bof2PLDqKh6/7UAXm0rQGnbzVT3RoXX6ZK/gyWkYCBxn1jVUQww36WdFqnEGfq1WS9MQo3tpjssrqgfW/Wy9K58PEDjz5EuUi59i+Php9ndw+i/vJpKaSZpdsD12c3J/Ms9JsLwYmYMevfQ+4i0gyYY/QkS2uBk74WYK6HYZj0tiqoaR/wosDQ/i8PAb72L0lBYjdy41n8oxBSD9CZL4HIItc89nwQLe3JU2C7gwHhA7lzGGBvilD+NqbK5x9+5yJ00SPpp0QNkC/i1uEuxxxRpBy09ERZhGrnPbYyIZBskwtlK6jJxfzSCqImj88H5Lrxk3KhhoajQJvqlEvVIxvDdkieQiIgFojcm2hY1y+8+Aw2LjSlG8t2kjUiucIXI20gZ8wXoUYlpEoeltZBTyBWEKERpNn/upV8Rly7HmATEB7PVvuUIUc9nhL1fFapy6sMhElmj045G5rJVkLRBckF7rVd9pziyn7+YUBacbEAM+X9Yf5m2FXhTEwMUCUWl6DSgfjNUIvcfydh/f+sQ= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0672; 31:8B/F4k4QRATxtVmFRELZl1gT42K7mEx/450XMZj14JFRaPkLwHkvLCIN2QJYuQ9ryUDGKz92zWp4zyCSKk71nBkrXFI9qjHh09tl+YSnA+mMlbtvlbZKMsh539tSm3YuDtBvG2ki67K5x6kp94RsCXpic46k3uhECGGWsvilT+4l4W40HWIdw99aeSQryIAVbpEtKSWwkGgBkKJdcQshhT5fXBomeR5PvP2eL+FQXS0=; 20:zpsCJXYVRdxh/pCC/MDiUPPrysvdN/0BF8yxg9g/VDgPYwS57nih4Y7tDKZ+TX7XnpsPeX2Gsa1hnij/1flTp9QQHxrP7T8UcfmpXe8kKOe9MFwnVXVm/3jEWHh+o6VG6Tjo7cEGLuTCKiUK/aRbAP1m/YpK2CLinWPrxsKgx3q73W9S3TB8QIu0HIv9yayuTfCfTG0p46JNHSFqZRs7f9dPqasdQYKXXzv0lBOvNgD4dygoFS7AoQOd/gIVupTdhhqrfK+ekVTQn7HPCUHAlnhDsJOWMHW2U6Qe9iLnrRby3VLXc1eFDKV/1mH+Hk0zqbqISaGeDbY2YK9KrBce/69rR0ijoC0UGzXp7EerfZov9PeAJcvtGqvvnqj1EVBTISdppa7r9IJbM6eb/Uu1ixnxYNaoVqka2HYFLVI2Cr4vs60c1hLiJCKba/IJXzKfr+RZY/fu2SjsLsta4m1bG/QjKYz2yWV8KHUn1KU8AMgUa4/wjMyjQXWlULuewsag X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:SN1PR12MB0672; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0672; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0672; 4:ZKzMpIw/200ZVcWbQ90x0+3fho+1b3byjbtriOdf1dGjivtaMKvUdl77K1vTxr6/RHToypJuskVYO0zUOLb+mSf5We3ce1NJvl6sLoD2pxS1TragkeOBdYI41yrbukWeSa/DKOLatojvrdZweyMDQyK/3lg7Dfgc2EgtumE9QN9jrqRxj+Fy3wX3hNa4Zuxt2ovL29IGsE+u0QQCAuDSSzPCCOjhYQa1MTtBgwPxSjAPlMvvLhyIOWFwGYv9b2CHmHIPkmxwPt/VIY/OfAWlxoQXsoWZHFHUr+3XXBdkEcrU/fleuOl+96ebvhPR+44q26w/wpBqdTJ24WLGy2uOK4Yq3gYQVhiYNaW0BW96CNlsNQ2EoMBCLIFHcsTwYpdqRD83c/axQjx+JqpgZTS+NjK1ee59h72RYreWw9YH8gA0CYlM25i7saqeddOZZ5dw X-Forefront-PRVS: 0073BFEF03 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6049001)(7916002)(199003)(189002)(3846002)(8676002)(50466002)(81166006)(97736004)(23676002)(50986999)(189998001)(2906002)(92566002)(86362001)(68736007)(305945005)(33646002)(7736002)(76176999)(101416001)(2201001)(81156014)(66066001)(5001770100001)(54356999)(6116002)(42186005)(7846002)(77096005)(2950100001)(47776003)(103116003)(4001350100001)(106356001)(586003)(230700001)(19580405001)(229853001)(9686002)(83506001)(107886002)(33716001)(19580395003)(105586002)(5660300001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0672; H:[127.0.1.1]; 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: =?utf-8?B?MTtTTjFQUjEyTUIwNjcyOzIzOk5qMEVtVWppbDRjR3VEOUpXWXJvK3dSY0lZ?= =?utf-8?B?d0hQS0JpTmFTNkt3dmZy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5eZjgAFt+iprZpiVL3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2016 14:54:27.5513 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0672 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.41 Subject: [Qemu-devel] [RFC PATCH v2 15/16] 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: , 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) Signed-off-by: Brijesh Singh --- target-i386/cpu.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 6a1afab..43e698b 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -22,6 +22,7 @@ #include "cpu.h" #include "exec/exec-all.h" #include "sysemu/kvm.h" +#include "sysemu/sev.h" #include "sysemu/cpus.h" #include "kvm_i386.h" @@ -2192,6 +2193,10 @@ static void x86_cpu_load_def(X86CPU *cpu, X86CPUDefinition *def, Error **errp) char host_vendor[CPUID_VENDOR_SZ + 1]; FeatureWord w; + if (sev_enabled()) { + def->xlevel = MAX(0x8000001f, def->xlevel); + } + object_property_set_int(OBJECT(cpu), def->level, "level", errp); object_property_set_int(OBJECT(cpu), def->family, "family", errp); object_property_set_int(OBJECT(cpu), def->model, "model", errp); @@ -2625,6 +2630,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;