Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754570AbdGJTmH (ORCPT ); Mon, 10 Jul 2017 15:42:07 -0400 Received: from mail-by2nam03on0062.outbound.protection.outlook.com ([104.47.42.62]:13499 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751817AbdGJTmA (ORCPT ); Mon, 10 Jul 2017 15:42:00 -0400 Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=amd.com; Subject: Re: [PATCH v9 04/38] x86/CPU/AMD: Add the Secure Memory Encryption CPU feature To: Brian Gerst Cc: linux-arch , linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, the arch/x86 maintainers , kexec@lists.infradead.org, Linux Kernel Mailing List , kasan-dev@googlegroups.com, xen-devel@lists.xen.org, Linux-MM , iommu@lists.linux-foundation.org, Brijesh Singh , Toshimitsu Kani , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Larry Woodman , Jonathan Corbet , Joerg Roedel , "Michael S. Tsirkin" , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Borislav Petkov , Andy Lutomirski , Boris Ostrovsky , Dmitry Vyukov , Juergen Gross , Thomas Gleixner , Paolo Bonzini References: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> <20170707133850.29711.29549.stgit@tlendack-t1.amdoffice.net> From: Tom Lendacky Message-ID: Date: Mon, 10 Jul 2017 14:41:51 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR1101CA0005.namprd11.prod.outlook.com (10.174.246.15) To DM5PR12MB1147.namprd12.prod.outlook.com (10.168.236.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b946f60c-5cb4-44cd-59ba-08d4c7cbb952 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR12MB1147; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1147;3:Ghhz16IoTapFmq1xCKTTJLmCIzND104OBGZaVjDB47RPHxXTERPvv5nwed3QunvOIZ4ZD1pWTqpZ5F1SjnfnHZ0rsGAC1IbIl8entAwIBepDCE/J/ShVqqkt59uzTsYx/f2wuO9JpZ8hta9MRMNiH2/tLpzneUfOTnBaq3JIrxzHVAIDbwBxKcFCuWuPqbayIDNkjYzSCgtMPghbzVeeawtZBHNvoAFUf7Wsqbf4NrUtPAQrSzb0SlebNCQDWLKmty9MTcqkpJClQfJ4lT/4PZ6NyymkGxNQddo7R7zHxAkR4U8U52S2g9/KvWnVD2yB0ahQXOtsFP95hbG9PLjxNjf+1hZ6ykQLmDN1xHL8Sxoixdvyjp246cAAaQbK+tSVAgA6JDrHgaLUGLGqgTUf5RopKKcCX1pg6/JX+rkM+GaCzIfmKzo5YYwtRxOwH4e7RaC3tTZshJUXN07t1c/HJI+xh6MmVnkee9q61eLwHxA2+eN6lgR6d618vzo1EO/RUrLfsmfBAT0gnibqxbOVPySX9RX33QyhaJOCGKEYGAheISKhmTVXNBJH1eX5ijhlLvPN1oP9C5afRNYValc3u+QNlFQ2LMCwC0gvq2WoSBOkAgnvlnJhxBUAFh9XqlSIQhWjeVPQgaD2WZtDtHFyYi9YiIDP8aijo54wA3AuQV7/pfOxOojSWpeYpRXxi0QboMulE5eRXEjWR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2UihD7vL5haUfmSdJXSPgK92LFiBQyttncNUSK8gLifWoaqBfRAi/Ag64reHMCNJzfeEZx6IfHuX7M1nNwdYTxrNZEyisFewFp6R6nE8SwUN8CUuXjljCOedWhP0bhDlu4YGWJVEPsyWsQU1IAn8ZldT9kYMyznK1J1Cs1myuYjQkQhgpeKLWS6VVvAcTNK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(125551606395959)(133145235818549)(236129657087228)(767451399110)(167848164394848)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1147;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1147; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ3OzQ6c2EzUENCbmROeE9xT3FkMDhBcldSbytJaWNX?= =?utf-8?B?MlZVeTFqeUtTbmEyRTI3aVBXMXlQRFphVkNWS1dIbVhPV1lIQkhOelJKTTZU?= =?utf-8?B?dXdhSThDb0RzYmk1R0o3NXpHb0FyaFJITUxCRHE1UWdZWVhndTFhTVJGallr?= =?utf-8?B?V2tUMzlLTC80cU0za3JHazJ1ZmhqNVNrZ0hwVU1jSExJOVpxQ3ZRVHZ1dHZ6?= =?utf-8?B?eTA5eGh5LzNHVHh2WWpZSm5Ca0Yva0g4REV2aE5rMnFydmtwN2doMnRqL2VC?= =?utf-8?B?cWhaM2N0ck10cnorQWtMQ3p2YV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FAxbmRXUlFlcG40d3FtZnFONTBUWjJkd2doeXhmK0czSW45?= =?utf-8?B?UVNwdkJrK1d2SmxKeXJZOU1lUXJHb3pjaWhzZnJmdkNNVGVWR05KZlN2ZzB2?= =?utf-8?B?MEhlbGw4Y093R0pLb0pGL1VFRjBlTkZhaFpxcUVPWDRtdnU5YStqTmF0MU5W?= =?utf-8?B?alMrcEJYL0lUbXovLzRRNmYxbFJHMEUycG5tbHRrSHNYR0FLdzkwS0VLaDJy?= =?utf-8?B?WDZMejNFRW5VYWN4TG4zblE2Nk5WMnZnam9TTlRHUWRSREFtWUxLaWtOQ2Nz?= =?utf-8?B?ZEJKYm41UHB6THFsay9zeEYyaUhDc3lnNFEySExBK1hCWHRKUmxYSlN6bm5z?= =?utf-8?B?MVRWM3M4TTFBSnJyaGFMWEVUbEtST1E2bWFUa2loY1J6NnltYitnbWlDQzNh?= =?utf-8?B?SE9FMHVmRVN3MXh5K2c1U3BYclZsSHFxdDZPa0doY2lzckNIdVZjeTd1Q3RS?= =?utf-8?B?cmpVcXc5dTJ6VXlhYTFhVXVkNE1EbGl1WnFtdnFZQUdkejNOWXIzU09oTG1i?= =?utf-8?B?Q0N3c1B5Tys0b2FsSTdjdElPblladjcyVytCZk9LOW1uKy9nQlpJMEE5Yzdr?= =?utf-8?B?cE5zUXFFZTdOQXVpZTNKQ3U4VytYL3dIdXB5WEljVGgyblcydXVKYzJlTFFE?= =?utf-8?Q?ZlE6SJes9yxh7fQiHCpmNQ8DG8K4KtW?= X-Forefront-PRVS: 03648EFF89 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6049001)(6009001)(39450400003)(39850400002)(39860400002)(39840400002)(39400400002)(39410400002)(377454003)(24454002)(2906002)(54906002)(72206003)(25786009)(53546010)(36756003)(305945005)(50466002)(7416002)(86362001)(3260700006)(65806001)(478600001)(6666003)(7406005)(31696002)(6916009)(2950100002)(23676002)(83506001)(66066001)(8676002)(230700001)(1411001)(189998001)(229853002)(50986999)(81166006)(65826007)(4001350100001)(47776003)(3846002)(33646002)(6116002)(54356999)(76176999)(38730400002)(110136004)(53936002)(7350300001)(6486002)(7736002)(6246003)(42186005)(31686004)(5660300001)(90366009)(4326008)(77096006);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1147;H:[10.236.64.250];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ3OzIzOlhJYjVrRjFPKzFzNnFDZTkyT1hiU1hhRG12?= =?utf-8?B?RVlCVGRBV0ZBaURKQlNqN0xieCtEMVRwTVhtby93L3RIS0FZTGR1a095RzBD?= =?utf-8?B?bnhEMWtHbldBRVBHSTlqVVFSOHI4Q2pIeGJzVEdjSXJQRnZOcURLRU44aDNJ?= =?utf-8?B?eTJDRDJrd1NGSmJNK3M2dlI1NzE1am0rZVN2V09lVjBlZVZPRjRON1crWVZT?= =?utf-8?B?algyNk1MWnYra1BIK3B1WHd4YjlqWXpWQ1E4a1hXQjBKRU1HZ3BZbTZxVTRU?= =?utf-8?B?N3ZoMUJhd2ZWWU1TbGh2UWMyM085K2tHaDNIcWVCNE9rWFMySzhRS3o5SVFB?= =?utf-8?B?dHlkZ2FySzdDVEIzRTB3bnF6K1ArL1JKSXZ5R0Y0RWFuNjdDUUZwZEFEbkp4?= =?utf-8?B?SjQzanpidkcrdTc1M0w4cjQrK00xYWowWDFlK3dMeU9pOVJJNTJLaFN3NmVX?= =?utf-8?B?bDFhTmhrcHVUcmlrcHE0dG9QbnFWQ2dMTllNOE9qOTkxVmZLNGd2eTloS2dV?= =?utf-8?B?MGwxay9LckhHbWxqZXhZWnFQTXlwVFRrajZaOWtZMURHWUhicHEzdTV5SjhJ?= =?utf-8?B?cStyQmtwSWtpZHdXK3F6eGVCdDk4bXA1d3pxaXBXMnEwNFFRcXpBMFFmM2dj?= =?utf-8?B?OW5PVjMySTc4ZENRUzY1MzUxNk5wSm56MFpCbkp4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?= =?utf-8?B?clFFNUtGOWU0YU1VRDBEbVRFV1IzUmFwWFRxRUFJTnVFL3k4SEV0RGZ3UytB?= =?utf-8?Q?vA44bHR?= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1147;5:FSwprQjv7jE9bi6kvIbhBoPZZZ+RpYqfCh0UIaKXFCwch59AYgdhmjPZAwPNmhwbuNPzeGXlOE8EMdoXFxyTovOmzjKQ0UGh9FhgiZgJpTttXhkxjsoIDkC90PR2VudgaQgwFwnVJx8+33so0/Zbzwzl7W2BG7iyrMm2losJUftyaDx38rJjCxpbBgF0anoIuXkNfPYJ0KBWQfFhk6ulekRGY5KLKiAwlbxm15YDrV7wr7GE4Uq9kajjyhd77ZfAyfn7JCAdT6kKFZMSGHsT2YCYyIKOOZZTwgMGwRMks0tnDYxJAKvZ0st/5iTVLderufI1mlvANNO/5fN4GfOZRRDfyQGhMu4Y+MOhkDkAvRLIu3OXY668+KNbN8ruAjaeiCmOgglJLs1wsg+a1m9UuoKuicSQypMWPdVHsiP287b/1/NDw9tt657NpzRQCSZMsz53nPqOIzIIkyjAOe8XpLE1m3Bx0KGWn5eyGt5IJfXiKMjfgINWLJZt909WcE9P;24:W10xrMVtTxaTBB9yLWs4VBeFRkNRYg5lVsBNIwgMiMKgU4jTicmZyRH3/7m4x5iplhU01vZzBrMBFVBVOeKluIijwS8eBdwZp+VxwPq0auw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1147;7:Ntf9geYfiSVZy4ZdDNG6nToGL9gjRG5OsB0skoeMoPgyMuQwqO8XsT+CbK4Wg2xrG629MmAbV6mJEkWzJemNHXoZO6t6NPGgGTTqGw9QW+k0Smfp60ahLBbDwyUtZzV+HoG9GV7I/n9uKtw1FJn1WumK4zmgGfH1KgYfeRSWpOuiu+dMTf0VgZQhP3xzP+n1P21/I5PGs7uG3VMP0GoODWMxdcVexq70WEVuIkbjND4uLmuBy6UDEV9bZBbShvFjal/Y8M06NE64n1wSdzB1Xnjkja/W6WRwUTqpFPMTyogFXZCbCwNRbBaTnpbgFjxU9JrhVqS4x4Lj1HTsj1jieoLOAl1kiuy3tmvWvFyn+xcElmBOZqJUVnYQzUGiOlp0G//zVeUgJFoTkS8kGc3DjRx0TSxdTbTFvFG681O4pWMwBXiRFNXih5prrhQK5i6gmBvebIqQid2t9k6sqvcaQx/pek2FXVLYvx4QoUUsVn645O7Y+ZNoz6CHcdH88LNZRgGfMdgF/XWwS3rGuPU44r2+hR/ArfeKLTp4g8R3gCtYfMY1aObX3lo2d8qZz+zEYMQRO3B2xK8gLBQgdyt+CLFCnQxKW7IgWPXztSp0rVTgLxWIbqDNQMd/YoNK4Pt8vQ1hCoUAV++sAZp/mG+CuX6r68Ea1wCZq5qRU3QTpqhld0hor6Ib/GsYh0WGaxekNeaY2kc6OL0OD+MPIlyDrto9zRD52TbRBdld4t7sOutJb2zahGU7KULPOJKnqgHF7XyGvWmIC72E8pCbv+1/paf6sdbtr2rdPfVVaPxW2B8= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1147;20:8zCn7E/Zt80Gj9QFV1egj7h8Q/cZ0NaYS1fQk1IWcV2BYZ2SgzRds6vvqs/02/GmnP3VPVPMYfPUEbJrSPG2833KveH9bn/5cKoT/hupbkp9OoisFuM0sa1phk9ejdsBZAVMjvTpZ9Nt7XxJm9e6Q8PtwljZoc7+YnJGqaArpB4uWZZmb39R5sv3Isu72r/uB2CR2kKoLvRu8DVCVY/IS1DYqyIdI2iBgVLC12UBDEfE0I4sV7G6uk+MxO3g3Tz9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2017 19:41:55.0834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1147 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4455 Lines: 108 On 7/8/2017 7:50 AM, Brian Gerst wrote: > On Fri, Jul 7, 2017 at 9:38 AM, Tom Lendacky wrote: >> Update the CPU features to include identifying and reporting on the >> Secure Memory Encryption (SME) feature. SME is identified by CPUID >> 0x8000001f, but requires BIOS support to enable it (set bit 23 of >> MSR_K8_SYSCFG). Only show the SME feature as available if reported by >> CPUID and enabled by BIOS. >> >> Reviewed-by: Borislav Petkov >> Signed-off-by: Tom Lendacky >> --- >> arch/x86/include/asm/cpufeatures.h | 1 + >> arch/x86/include/asm/msr-index.h | 2 ++ >> arch/x86/kernel/cpu/amd.c | 13 +++++++++++++ >> arch/x86/kernel/cpu/scattered.c | 1 + >> 4 files changed, 17 insertions(+) >> >> diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h >> index 2701e5f..2b692df 100644 >> --- a/arch/x86/include/asm/cpufeatures.h >> +++ b/arch/x86/include/asm/cpufeatures.h >> @@ -196,6 +196,7 @@ >> >> #define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */ >> #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */ >> +#define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */ > > Given that this feature is available only in long mode, this should be > added to disabled-features.h as disabled for 32-bit builds. I can add that. If the series needs a re-spin then I'll include this change in the series, otherwise I can send a follow-on patch to handle the feature for 32-bit builds if that works. > >> #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ >> #define X86_FEATURE_INTEL_PT ( 7*32+15) /* Intel Processor Trace */ >> diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h >> index 18b1623..460ac01 100644 >> --- a/arch/x86/include/asm/msr-index.h >> +++ b/arch/x86/include/asm/msr-index.h >> @@ -352,6 +352,8 @@ >> #define MSR_K8_TOP_MEM1 0xc001001a >> #define MSR_K8_TOP_MEM2 0xc001001d >> #define MSR_K8_SYSCFG 0xc0010010 >> +#define MSR_K8_SYSCFG_MEM_ENCRYPT_BIT 23 >> +#define MSR_K8_SYSCFG_MEM_ENCRYPT BIT_ULL(MSR_K8_SYSCFG_MEM_ENCRYPT_BIT) >> #define MSR_K8_INT_PENDING_MSG 0xc0010055 >> /* C1E active bits in int pending message */ >> #define K8_INTP_C1E_ACTIVE_MASK 0x18000000 >> diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c >> index bb5abe8..c47ceee 100644 >> --- a/arch/x86/kernel/cpu/amd.c >> +++ b/arch/x86/kernel/cpu/amd.c >> @@ -611,6 +611,19 @@ static void early_init_amd(struct cpuinfo_x86 *c) >> */ >> if (cpu_has_amd_erratum(c, amd_erratum_400)) >> set_cpu_bug(c, X86_BUG_AMD_E400); >> + >> + /* >> + * BIOS support is required for SME. If BIOS has not enabled SME >> + * then don't advertise the feature (set in scattered.c) >> + */ >> + if (cpu_has(c, X86_FEATURE_SME)) { >> + u64 msr; >> + >> + /* Check if SME is enabled */ >> + rdmsrl(MSR_K8_SYSCFG, msr); >> + if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT)) >> + clear_cpu_cap(c, X86_FEATURE_SME); >> + } > > This should be conditional on CONFIG_X86_64. If I make the scattered feature support conditional on CONFIG_X86_64 (based on comment below) then cpu_has() will always be false unless CONFIG_X86_64 is enabled. So this won't need to be wrapped by the #ifdef. > >> } >> >> static void init_amd_k8(struct cpuinfo_x86 *c) >> diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c >> index 23c2350..05459ad 100644 >> --- a/arch/x86/kernel/cpu/scattered.c >> +++ b/arch/x86/kernel/cpu/scattered.c >> @@ -31,6 +31,7 @@ struct cpuid_bit { >> { X86_FEATURE_HW_PSTATE, CPUID_EDX, 7, 0x80000007, 0 }, >> { X86_FEATURE_CPB, CPUID_EDX, 9, 0x80000007, 0 }, >> { X86_FEATURE_PROC_FEEDBACK, CPUID_EDX, 11, 0x80000007, 0 }, >> + { X86_FEATURE_SME, CPUID_EAX, 0, 0x8000001f, 0 }, > > This should also be conditional. We don't want to set this feature on > 32-bit, even if the processor has support. Can do. See comment above about re-spin vs. follow-on patch. Thanks, Tom > >> { 0, 0, 0, 0, 0 } >> }; > > -- > Brian Gerst >