Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933207AbdGKPNC (ORCPT ); Tue, 11 Jul 2017 11:13:02 -0400 Received: from mail-co1nam03on0060.outbound.protection.outlook.com ([104.47.40.60]:21786 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932229AbdGKPMy (ORCPT ); Tue, 11 Jul 2017 11:12:54 -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: <602d1182-6f18-5954-c1d9-5f28e7b447b5@amd.com> Date: Tue, 11 Jul 2017 10:12:41 -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: BN6PR1001CA0032.namprd10.prod.outlook.com (10.174.84.45) To DM5PR12MB1146.namprd12.prod.outlook.com (10.168.236.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cdea9b3-8174-4be8-7972-08d4c86f4b31 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:DM5PR12MB1146; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1146;3:mdmokIbfPzLX5tBTNwzmog3am6aqxKz75eFMR3D78jd44Gi8NRTf/oBZehGw/uScGA0qYh8qLN5y/GveBh3QNNg3m8S3WF6sfdz5MrnG1asY+/xH424sni9laeKSRQqBTmYwovG6IJ+CbJduJqSXiI8M6jU/k+0Jir7AVGo0i+2EkDHSaUOSRdU7ODl74Pi5kD0jY2J8EZWCY/YPc8KOX3xJ+JAWNDLl7ova8MuN0a9rA3M1XEd394wIneg0w8m+Z0GwD1yfHGZ+j+8sVcEoyifqbbUnkujAdz49N/nGTIXsqy7uC5CzfGzwaZXCw9eq5576I6pfa3FPwQfUBFLU9GmeRIg0QCh5T2f9R0WCpcVUIzlEc06YDDzezfsmGpWnzzyeCy5lsZLYcQ5vM1dYvPGogA6XcVmkwKkkHNKvUbAA4EIaSJlRBahCPzO7hEklbsl8uSOEcXvOYWslwilLhNZUCN8v9TLuAANf7DoR7Rgx9b2Sg/MbNYoacjJc1mD3xRo8CvPHfnlsXwzkNh4rrJW6I1emSJ/8EJyU+AMOI2CNnRntQ7Mgk+rIt+Zq19X/fHIOwu/NyA9Dw6pv/ar3PDw2g5YdDUCuBqPBF7C/NRVz5rLAe6IRdhPKPPPIrCa26vTtQVo0xU+UhAsNE++ItyUw5eDQLMcPzbb5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fmr9gL1cjX0nyKR0ti5aZh8p8eQBmNRia20+EGwB0E/bM/AwyYB0PQl8OzFQCaf7mcgFBIw69HJaU8kmXiP0lu7P9GwENPJu6VDSbEL6ppbOO5eGeyXhhbZIJcOpxzkMcCyOBK19JTmxqKWAFVY7aS8qRfycEdwfLe4VRLECOWsqt4IGwvuggr6Fa4cmO/Hy0ThMzgcacsUPkR/9oLHJkmVFfqNRxEGw2mC7AZMzN6nD1L+B8Pc 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)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1146;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1146; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ2OzQ6NGlEcHJKc3RDVE9rM3p0Vm1IaFJRSGpDc2Rm?= =?utf-8?B?MDZDQklGQkphekRqNUl1OEZFNHhMaUIzdjYzOGhlZm11YXRkSVRRdXlxMlVL?= =?utf-8?B?TE1aeGNIbGp4NXJ0bkMvcjQyOUh0TFJoVFBxcnZzMHdxV080U2JKaXJ1aTFM?= =?utf-8?B?Y0trYW4wZ3llWHlabjY3bjluOXVnQ1M4c09pRFUxbXVWZGl1c3dXZFl3N3Uz?= =?utf-8?B?UnQ3aWZmNTY3MHo3TVNIZlZxS0xvRk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1MjZSZUJoVHNuS25xbzdGTTZ4OEVKUDhmV1AxVmU5OE9o?= =?utf-8?B?eG5JK1BOSHF6dlpIOHk3RUZqNWR4UmZQR1RQY3VSbWJ1RnVzZWUyek9PY0Jp?= =?utf-8?B?b05DMEhpRXkyT0JBY1lwL3V3TWJ1RkpVRlVGcS82NTE2aTU3amdFWVhYdjhX?= =?utf-8?B?OHA3L1BZdkJrdlYwaHpIRGcyOXBDSmxDQ3YxQit0OXBVemRDeDRXbXJOOUQ5?= =?utf-8?B?SUJZUnY2bXNZVlRNV2srdEFHdit2cTY0UE9VakZvbEFCZFk5RzVpN1ZJa2hG?= =?utf-8?B?Mks1V0c4OG5rK2orV2ZJQjl1VlYxSjRaaW5SRm53cCtxaVJUL1RaZllkSEpR?= =?utf-8?B?K1JQQXRzTURkdW5CMXA0R3NhQ3grOEE3S3BKY1B0TzJWaERXV2oxZEErMi9n?= =?utf-8?B?S0Z0c3VuTEZRUjJjeHVxSnBKVW1sTjRQcUx2dnJDMzl3Zm15K0xWN3FxWlhQ?= =?utf-8?B?L2x0VHhqYlByd3Z1RmFwdlFDbkl3U0tsKzYzRUxqTkxWcWJkMmJHdm1WRjBO?= =?utf-8?B?TTBGR0JWWjEyWlc0NmxrY1Iyc3RlMHJYb2NKcGpaWk9TUC84Q2FHYlZLbTF1?= =?utf-8?B?UG5jWE5OaDZSM2F6RGF4Vjh2UnpqNm91WjdSVC9GcXpLTUJJSldOeFloQlAz?= =?utf-8?B?b2diL2FLbnFVMW1BOFVuN0Z6YUJ4eDc1ckRaWTRHSEs5aVE0RW9KS1lmN3p6?= =?utf-8?B?eXlrd2R6eTlBL0xRTzBEb1lDQUk2ZkJDc051cW1GeU5Td1o2QTBmNnl2SlBl?= =?utf-8?B?M1ZGUTZIMXc9PQ==?= X-Forefront-PRVS: 0365C0E14B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(7370300001)(4630300001)(6049001)(6009001)(39410400002)(39860400002)(39850400002)(39400400002)(39450400003)(39840400002)(377454003)(24454002)(5660300001)(50986999)(50466002)(6116002)(3846002)(31696002)(7406005)(76176999)(93886004)(6486002)(7416002)(25786009)(7736002)(77096006)(305945005)(230700001)(189998001)(229853002)(83506001)(1411001)(54356999)(3260700006)(8676002)(86362001)(81166006)(4326008)(6916009)(54906002)(6666003)(2950100002)(2906002)(6246003)(64126003)(31686004)(53936002)(38730400002)(42186005)(23676002)(65806001)(53546010)(66066001)(4001350100001)(47776003)(7350300001)(65826007)(36756003)(65956001)(478600001)(110136004)(33646002)(72206003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1146;H:[10.236.64.250];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ2OzIzOkVYWndiaVhyRWVZcnNYMXBrKzNacCtsTVFw?= =?utf-8?B?WVVJckhJODVUczlYSkFxYVRTQmNBVUZDc3hyQU9JYWNwL096dE91amlnaXpj?= =?utf-8?B?TEoweXJyaTBRcmJqYjNGbFdYU0pvaERLRlNkU2V3WXhzM25TUm1XWFhKZ0Vk?= =?utf-8?B?bXFuNjJUYmZ3d0V5QTBQbDYzN2k5ZHVvSzFFZm5tcnljUjhLSy94ZjVheDlh?= =?utf-8?B?WG9iYmVPUlo1QlV2UE1sTkJUbFltdkNMRzBaOE9hWUhtZURKRnFCSWZ3NmZh?= =?utf-8?B?OENlT0h1YjlxNUhRQXUvZmR3RWZKbmdCZlZVMTBwdGdyUVNIMUhQTSswTlBL?= =?utf-8?B?aXc3MWhwd3NDbXF2c3dHZDh3aVFCb3BrdTNvNTlLVVR2QTQ2QS9TVVYxenpW?= =?utf-8?B?NHJwek1NOXdmRy9tTDRpdjZldEo3VGppSjhCK0R0NUYwRVNEQ3pIamg0QmM1?= =?utf-8?B?Wnh4OVE0TGNlNXB1US85Q1VBTnhXdjFiSkdIaDNrMDZsV3VxbW5MM3kvU2Vm?= =?utf-8?B?OGtxRHRhN1p5MGQwZE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0liODNDOTlodit1T3Zh?= =?utf-8?B?bTQ3c1YrQmxLb1NVd3drdnY4YncycU9TVzRWaldTdk54S01MdE5JeTlUMHhT?= =?utf-8?B?b0VlWUQrZ3pRQVprVnBWckhMZ0Zsa1pNZ09MN2kzckxVUDhSOGtGY0lQYkh3?= =?utf-8?B?MmV3cXVBbE5qdTNlZVl2VVRXa25LQTJzWmJOQm5obTZSdTdyY0gxYkhIQnkw?= =?utf-8?B?WVlxeTR5L2xpL1dpeHR1a2crZXdDa0VlMFFSVERrelpXemwyRnhxTzJnTlkv?= =?utf-8?Q?4fWn7hy?= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1146;5:Asc9HqWQHRf/95KXLQHox4hivpxKa2EPPCbp0UrXQwzJcIaXGeGX8Hg0LliCfQK9Oy1ymfDGg60/A5O2s2qN9rmxF3y3Q9lImPoqc6PdgQac7XLdhFCI7oLLCL0WxvAaGVD0LoICm+JnX9BOqt4oPuDsi5TdIRQcnTnLqIUdwGQZwbAA3M5Rizfvxmy3K/X/s4z+vYDeFyuUCFfk52L8XPcCfDgihw/9C398bMW67g3u8eoANN1RhR8nlJijVepLA1emV/Eg/YXYkoVwZxtOp9D8mhkdKjHooIGKOtj8qmkaUdXYQL8nh6vclyNJyjIbTBuIgQAxi4u19t8L20W4QBvShjI+xEK1uqbyeQCg61MMJKJ2j5tD69EGimEsl3YQeB6Hrg4U7DXVoQtDNBfZul98dhyS5r7pkHxibPLjBRugpfZwul4ESUthNnoBZupWSfBrLTkcpjqfonwGXpwoDTHU/V9b60z9F3VF1uO7NznNcElX0TUFO55GWKZY3G8m;24:tPdCXMmwNr8TyJz+EyVlfql97wQ4SqPAJDcTpfAudoSshGUXrccry7FWd3IsjLXAtgX9KrHKq+OQi3icX2KL+YhepVaono0WrGt1Siq2UaE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1146;7:DldsjIPpvoOuiZsAsZWI0o4m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amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2017 15:12:45.7353 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1146 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5501 Lines: 142 On 7/11/2017 12:07 AM, Brian Gerst wrote: > On Mon, Jul 10, 2017 at 3:41 PM, Tom Lendacky wrote: >> 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. > > If you change it to use cpu_feature_enabled(), gcc will see that it is > disabled and eliminate the dead code at compile time. > >>> >>>> } >>>> >>>> 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 > > A followup patch will be OK if there is no code that will get confused > by the SME bit being present but not active. The feature bit is mainly there for /proc/cpuinfo. The code uses sme_active() in order to determine how to behave. Under CONFIG_X86_32, sme_active() is always 0. Based on the comment related to patch 7 (ioremap() of ISA range) I may need to re-spin the patchset. I'll include this change following the recommendation from Boris to use the IS_ENABLED(CONFIG_X86_32) check to clear the feature bit. Thanks, Tom > > -- > Brian Gerst >