From patchwork Wed Dec 6 20:03: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: 10097101 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 961BC6056E for ; Wed, 6 Dec 2017 20:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8700929D95 for ; Wed, 6 Dec 2017 20:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B8D429E95; Wed, 6 Dec 2017 20:20:26 +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 D5F0A29E01 for ; Wed, 6 Dec 2017 20:20:25 +0000 (UTC) Received: from localhost ([::1]:57613 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMgB3-0006xx-ER for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Dec 2017 15:20:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMfvg-0005r4-Bl for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMfvd-0002Qc-56 for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:28 -0500 Received: from mail-dm3nam03on0083.outbound.protection.outlook.com ([104.47.41.83]:51680 helo=NAM03-DM3-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 1eMfvc-0002Q6-TM for qemu-devel@nongnu.org; Wed, 06 Dec 2017 15:04:25 -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=LDKSMpx/6j3Xapqxaz+BPc0m0qFyyY0vRY6p2U4m+mA=; b=hxXZr7z7PzzXhJQ++j8cPQJ5P8UZSpvjxwEBTpxbLKDi3BKdUbI8cWFILN16aNObCBWhQRZ3nj+6hno3Zh9LXY8D0pfebL53OyUMjCFruNAX7RM6iuIb6W9Hd4XP8gsXvjk3QCzm24/U8mFUvaHsPgIk+98i55UC3qvAQj0YVRs= 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:19 +0000 From: Brijesh Singh To: qemu-devel@nongnu.org Date: Wed, 6 Dec 2017 14:03:28 -0600 Message-Id: <20171206200346.116537-6-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: 008a5f95-38fe-4450-2ee7-08d53ce48aa3 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:+1kB4Z3dFnPIOCPLVydMVBIYaJ3VJe9P77CepSO7zkwOCZPWkABvniU1GkddjEr1T4LRwe6iZyss9vdYHG4dmrgcV45deppYbnbBr0nnbFgDiQb1OkM0NMyGnsYK1FLjbf1J6j371fny0UKJrYQuI3BpTmGIfsCTgIblTEXBqW30Sq6OMpZwy1Feee/zKpFBeliwfUoigCVtm2X1YseXsdmQ3OexTIEk8tveaVeqEI2jlv/oVXIBSIe9fwWv79MU; 25:ijFRGRcubFiVQp7Masj3XkcGDnNf+mmjHd/B2WEH0gIxM7dWLS8UcYQjag4m42p+FkwCi+tTS67gIlbwgVNBgTJ2IB6W0O3pkby4FZzMqykjxkeJtWtwaeGElkw2c2KrmtDdcVRSvyB1rfN0HhCMSi633cOEjWCKZauSjzPXF8mqm/9HR7dUFbF7byVWKtIg9FzL/A4eqSvU0gJOX5POw2yVx6R0QYo9nVMOjsKncmil/SXmcPHyxEU1bjHRuJuXh6yYiWzM1squqNkY/YAnB3EsptBVqGdYHDV1njYn/Ef6eXLGgLhewXb3rFiOfNV+OHY654zmV9gnueurxOLO7g==; 31:Z3WZ19DJcT2m//9e5m1GRyVSU8xUsJdwNxmET4kIuNJXHh9Zpo1XADby4iIxBFh4AjyfFs4d5sffpjtRxsEwJQfBLyZSVhUCGB5MjlHoxqKxaCr3IUTd+reXha9UtNKwIFThy+5IV/gH3+7ZE5ifKEawsLszt3UNXBlDUkFJLNvWxSVVnD0f4SLmij1ORfMklrn1bWw7K2/CZcGaQRC3kqJATrnuPm7g0N+UN+TGpzg= X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 20:vbHQ8yHntAFAWQ/fnP0z+3jRiI/Qhj9UQL28MSaq6xMOsM2l7sbRGrFKmWJI2KvYG3PB4BD3VkR5dyiO+68Kq/q0Tx0qRyQzRC/u9Toc6bDv7KJAuq2rQS5DjsGT+azUdBRXCgFJlxJMEWMCxboHjo6ppCUiEO2sRxOhfR5THbcVXe4kkY+HAgYfpZdXvf2Tnw+DhaAsZjeoHcZtjWxz0AdtrujVYQsLMN3GnNKk2jzipPTEcOa819zijAEbKRdbgfezmZnUcvKkGSTyLJ3wnczu5IvKILFy7fmuGnlbcH+LzKD9gQ/TdsiNNE+PUMfwpsYK3slLbqlUCiWmogvLfY1Kbt1q6l+frokAXjJF5d9zsB70EvP/8bG7W/kSquqpy9q0gBvUrvvGFEdS8Qin1gwJE35wtL8pBxBalWc/pkx7NmYVsOD7DJeTLUlLiThV4LlwPTOQ+L/dC0zMFlOHoQZ49dlfSY5qCIKDOlJskcbzy8LpIrpIzGiJLtO3Uo/J; 4:P2bBQzjzK1dR9vspOPGn+MCI1owbh1moEUoAznNM6B4jjBDnuobnoTgRUEwcnZonr134WSCjRojq74J0yNROUPDCoJjAxM2K0sGwj+/hK34y0LI+9w7IT5gvWA1WpLI0lQejw7jjXKJ/2vyBgMT4cJINOZ/Bf1WZHpQlYXLUg2qK/+Ccn3UpjP4+R79KGVGMIVZza0LGW5pcq0d5pAt4WmcVGo71lStrnwPJPyWKLsdXV9lUZIOmUlq+P0QWdMZMGkP4rAgMtbPzIxZ6WLSS0YcV/IIyLIPGK1N8ieCSYK6ak7fR8xxT1L+p/IlZC5UQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); 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)(6306002)(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:XU1Hq9fYW7VsgwDHUo1f0GyyzkqO0SLChmCzRAJ0u?= =?us-ascii?Q?t6ZQ2y4GSKhucXWlmebU7CcHNdfOmFkooyEOyboz2qRTHH1UdCFaoX8t7MLF?= =?us-ascii?Q?XrWqYMQEQIj59ZL9hyJVWcOdgJoa06nGCcmoCu4KPdEs7BYR739SbphkfwF2?= =?us-ascii?Q?Gh+47UOC55uy+qBbZ8pZGxezlSGTyCmxbJmo+cnoaLs84/rFxuMkU2PHAD5m?= =?us-ascii?Q?NLzfWTqxHg9ceFwf1aPOvPjTzuE/QsYuo16U6b562hQYDtrgAmRAQWbbkTS1?= =?us-ascii?Q?XsuUWrE7oDg1rSKiLRx5u9UHqLaFAhcIVEJumRL6q90vU+25GCobKkKf1K5/?= =?us-ascii?Q?VZgl5OoA6iN/ZjeXM9TE8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uFdW2W+Uy4npHrWWxjhmy571IiKPgiYok5y3Lt5UfwHlnFNGxJ4NbumUT02oXA1bDqmPjw36LCCEL+/sT5EoaudtC8gMumWrjfw+/pcZWKhu8t4618xFAsrtDT8l5pG3mCsIVjiGx6yOhXegkkXAkd8r7UPix0uZnEtFKcQovtlwRBi/yxw2tZ6d9Km3vsRf5AYBpy6tXEY+FnZGrSSzDQJuazjlI02/Z X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2017 20:04:19.8953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 008a5f95-38fe-4450-2ee7-08d53ce48aa3 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.41.83 Subject: [Qemu-devel] [PATCH v5 05/23] target/i386: add memory encryption feature cpuid support 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 AMD EPYC processors support memory encryption feature. The feature is reported through CPUID 8000_001F[EAX]. Fn8000_001F [EAX]: Bit 0 Secure Memory Encryption (SME) supported Bit 1 Secure Encrypted Virtualization (SEV) supported Bit 2 Page flush MSR supported Bit 3 Ecrypted State (SEV-ES) support when memory encryption feature is reported, CPUID 8000_001F[EBX] should provide additional information regarding the feature (such as which page table bit is used to mark pages as encrypted etc). The information in EBX and ECX may vary from one family to another hence we use the host cpuid to populate the EBX information. The details for memory encryption CPUID is available in AMD APM (http://support.amd.com/TechDocs/24593.pdf) Section 15.34.1 Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Brijesh Singh --- target/i386/cpu.c | 36 ++++++++++++++++++++++++++++++++++++ target/i386/cpu.h | 6 ++++++ 2 files changed, 42 insertions(+) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 045d66191f28..0cc7bb88ce2d 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -233,6 +233,7 @@ static void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1, #define TCG_EXT4_FEATURES 0 #define TCG_SVM_FEATURES 0 #define TCG_KVM_FEATURES 0 +#define TCG_MEM_ENCRYPT_FEATURES 0 #define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP | \ CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ADX | \ CPUID_7_0_EBX_PCOMMIT | CPUID_7_0_EBX_CLFLUSHOPT | \ @@ -528,6 +529,20 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { .cpuid_reg = R_EDX, .tcg_features = ~0U, }, + [FEAT_MEM_ENCRYPT] = { + .feat_names = { + "sme", "sev", "page-flush-msr", "sev-es", + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + }, + .cpuid_eax = 0x8000001F, .cpuid_reg = R_EAX, + .tcg_features = TCG_MEM_ENCRYPT_FEATURES, + } }; typedef struct X86RegisterInfo32 { @@ -1562,6 +1577,9 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_XSAVE_XGETBV1, .features[FEAT_6_EAX] = CPUID_6_EAX_ARAT, + /* Missing: SEV_ES */ + .features[FEAT_MEM_ENCRYPT] = + CPUID_8000_001F_EAX_SME | CPUID_8000_001F_EAX_SEV, .xlevel = 0x8000000A, .model_id = "AMD EPYC Processor", }, @@ -3110,6 +3128,19 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, *edx = 0; } break; + case 0x8000001F: + if (env->features[FEAT_MEM_ENCRYPT] & CPUID_8000_001F_EAX_SEV) { + *eax = env->features[FEAT_MEM_ENCRYPT]; + host_cpuid(0x8000001F, 0, NULL, ebx, NULL, NULL); + *ecx = 0; + *edx = 0; + } else { + *eax = 0; + *ebx = 0; + *ecx = 0; + *edx = 0; + } + break; case 0xC0000000: *eax = env->cpuid_xlevel2; *ebx = 0; @@ -3549,10 +3580,15 @@ static void x86_cpu_expand_features(X86CPU *cpu, Error **errp) x86_cpu_adjust_feat_level(cpu, FEAT_C000_0001_EDX); x86_cpu_adjust_feat_level(cpu, FEAT_SVM); x86_cpu_adjust_feat_level(cpu, FEAT_XSAVE); + x86_cpu_adjust_feat_level(cpu, FEAT_MEM_ENCRYPT); /* SVM requires CPUID[0x8000000A] */ if (env->features[FEAT_8000_0001_ECX] & CPUID_EXT3_SVM) { x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000000A); } + /* SEV requires CPUID[0x8000001F] */ + if ((env->features[FEAT_MEM_ENCRYPT] & CPUID_8000_001F_EAX_SEV)) { + x86_cpu_adjust_level(cpu, &env->cpuid_min_xlevel, 0x8000001F); + } } /* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */ diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b086b1528b89..a99e89c368ba 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -463,6 +463,7 @@ typedef enum FeatureWord { FEAT_6_EAX, /* CPUID[6].EAX */ FEAT_XSAVE_COMP_LO, /* CPUID[EAX=0xd,ECX=0].EAX */ FEAT_XSAVE_COMP_HI, /* CPUID[EAX=0xd,ECX=0].EDX */ + FEAT_MEM_ENCRYPT, /* CPUID[8000_001F].EAX */ FEATURE_WORDS, } FeatureWord; @@ -649,6 +650,11 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS]; #define CPUID_6_EAX_ARAT (1U << 2) +#define CPUID_8000_001F_EAX_SME (1U << 0) /* SME */ +#define CPUID_8000_001F_EAX_SEV (1U << 1) /* SEV */ +#define CPUID_8000_001F_EAX_PAGE_FLUSH_MSR (1U << 2) /* Page flush MSR */ +#define CPUID_8000_001F_EAX_SEV_ES (1U << 3) /* SEV-ES */ + /* CPUID[0x80000007].EDX flags: */ #define CPUID_APM_INVTSC (1U << 8)