Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754468AbcKJAtd (ORCPT ); Wed, 9 Nov 2016 19:49:33 -0500 Received: from mail-by2nam01on0045.outbound.protection.outlook.com ([104.47.34.45]:63936 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754230AbcKJAt1 (ORCPT ); Wed, 9 Nov 2016 19:49:27 -0500 X-Greylist: delayed 857 seconds by postgrey-1.27 at vger.kernel.org; Wed, 09 Nov 2016 19:49:26 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; From: Tom Lendacky Subject: [RFC PATCH v3 03/20] x86: Add the Secure Memory Encryption cpu feature To: , , , , , , , , CC: Rik van Riel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , Konrad Rzeszutek Wilk , "Paolo Bonzini" , Larry Woodman , "Ingo Molnar" , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , "Thomas Gleixner" , Dmitry Vyukov Date: Wed, 9 Nov 2016 18:34:59 -0600 Message-ID: <20161110003459.3280.25796.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> References: <20161110003426.3280.2999.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR20CA0022.namprd20.prod.outlook.com (10.173.136.160) To BN6PR12MB1137.namprd12.prod.outlook.com (10.168.226.139) X-MS-Office365-Filtering-Correlation-Id: ea0daff2-beb3-4990-2da3-08d409016a6f X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1137;2:ymA4a2/0uhmRMQLwFEqEZdhVIyT3OwfW7BB1P61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6y+Fz+kVSuQfhWEDj8G8lEQoqj+N0Hvjn4un3ve0uDv75QyjJzLVIfIE/iod3BlnrxPsmieVq0I2Y2dA9SlxHGtKR+l0agyQl8Wnyly6PP9APFLsfNP/30ZxjN2OcoizA== X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1137;31:u8dsggYCfVZUtOwlbxTuGdoYwxddbVUg7SkedRMNmN9iFRDhDDyvD3ifF8G+lNQrh7wMv4sM0xSL6moi4aWrPdfhK3lmrkheV5KwanQuQ2CF/uffhjfwUdhJ5FAN3C1wJLlTPcTXCGUTqjJU3tk43UNm+7JnrdvO0joITI2XX9LXMqnf5xMmdKtk5NxiPJ5ztoUATgMNNU1AyVYGs1vy8jlBvSmPIuCHjLuaDYxGv8yXKD4sB0vor6XcfylVnbuNB7TDW6NoM40WDsnjYlH77Q==;20:0+mytwqgMqb5nshuh+X8LkkVReSooGvGGUTU3z7U9Ll2pQngnbK7AVy70gqWiHi0VXKqqnyLYtkErYoaOeAsAsghmoUY2mvaBr3SAgDg0jAI6f3GeXrPDAj5mfoIj7KIu+iDgAal8nxdH6q44shKkkm5cdmAeMGTssmlUAVjaKkU6qSkrno25Ak7Upk4ameFT4f+6Sj4Qm/G6FXMCEPY6nSuMZ84fMOE9/1yA74bYt2NLhA0WUx3wjOv+CFpAL4q/ut6g7HeklLYAqLCG2NHU0sMmyW2NrTGS/PaQ5bX6Ke+Yff8c1uFbg3gvjQz93Y2qPbvcIeBPLaIzIDDqbbFVlCHuB0Hd0soNBifxaDBt7mqGqSvTtmCf02ce3Yv3FoJ4FouVvHMgHAkrec9SndreOVhsu2MdZjM33b55VW9lGccNj9aB+m7/Y2omgPstzzD8ztUnHeAyhTFtCPvNnoZyNXvhy3PA1om/tJCJJeIdIkA1Qs+XWz61WB+PTr0uHiN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026);SRVR:BN6PR12MB1137;BCL:0;PCL:0;RULEID:;SRVR:BN6PR12MB1137; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1137;4:i/XetHUqKLd7b5nx9k3cFIiXYmCwIhUdwG6knxrp/pIPhhq5jfwcADM/u6oQ+QbBg5LKiRm7LVUA75777ydWvA5gJkS5c6eGbxN6+91Qn97QvSuwOazRdp1BPQQhF9fzj3ctl5J6NPQlHNU/XefbZOFFMC96dhpGKKskuM60U7dGSnvSZ0TiDFvwadE5Pv8Mq2lRBDhdqVt/W+p4nXJMbVbK2LPaYF7qJMTzDjZBNIT7eDom+StYnZYnR1RGlBmtcDMVoIt647d5NJ5o2MzpieGPASkInI4izuH+FwwNbqBjMNGRQ9JMdX4K3UntoAcQZKjQgk+7fC0cDkYOY92im3tWKHyYcNJHSclZH0wyRVKtLVWb5HX4wQCyct+EP7pa0Jhpr18LTe3L4uTJh3mt9Z+AcNiBiBlglj7nFFgDjesyBl1cciwaRya85gm9fXyl/h2wLbj3jvg9789m+H18Hz4w9+LG5jorDrPiwjjR7RJoLJbuRyHjUhFYoks0rX2X X-Forefront-PRVS: 01221E3973 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(6666003)(42186005)(53416004)(106356001)(586003)(105586002)(3846002)(4001350100001)(6116002)(5001770100001)(2950100002)(97736004)(83506001)(50466002)(1076002)(23676002)(77096005)(68736007)(101416001)(305945005)(69596002)(7736002)(7416002)(66066001)(5660300001)(8676002)(7846002)(189998001)(92566002)(9686002)(33646002)(230700001)(97746001)(4326007)(47776003)(86362001)(103116003)(2906002)(54356999)(2201001)(76176999)(50986999)(81156014)(81166006)(71626007)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1137;H:tlendack-t1.amdoffice.net;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-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keRs5xaC31iAVbfrf6Utz1imbwo8zij9EoOYKM7KhxPKeB/zc+QaiZLhdPmSLbspMC+g86OYJW5RJXjLmO8etjkEcx6wMr1Gz8hgeTJJTlhmRlmRNdnPSQfsUDDkdwhLcMnejCIJGEBkSlBtfCWRHMtX0RePpAu7svVbma1LraYB5Rhvom8c4vd2yufY0uqJvpuXX1f90Ur/oMQTdtgqE3OUBNcVBdK76SlH1nhxOtx71NaB9cfhLO26+40TD3xTjHr7EXlx3LayQeIUHgsVi3f6aNwpDDdOn+oF33W635EPh6l0/h/s0jos5g07T4Smw7z0rin59M=;5:eGWheCmiY+zms4gwO3KLn0d5Pall+hD6ph9GaPx9pcwwcuj9YN3mr/x+M6B4qcMApxpLypQMiCkZ47oPQaNRGP87xcAeFrrHLUOKByr/fQIRcpxBRtIwhgj4hcxsvpTpIONhFrlVY4blgoYacltTeA==;24:njb62VjQFHqLy3d8dJS/owdIYO/ygOdemx1tOL5usaPkHC1l/GvfzcxYZWNPc8MxKzmkwIHbVypQZ/1BMjHbtix7mI9JrWtUz97m3t3hn7s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1137;7:7jvugVXClv3Ijo+R/pCIPbB0cmLT4XfRtYXLNpShmz8UuzePSczqdaZAh3Foijad00M+m9B+HVAJxbdUcvXf5fvdRUmzc+USlqDbCv53OGW16QuI3QNjobuvl/6wHTOXaUrpWFzjiFXLqPm2mCjI4nKXOzNk3zy6uQIa0tRIkzNHomcT+BVNLupuB/+890Qx8PxuxoIYpzb+TZxtf8i3EZ33lo0Ows33akulad/2cdCYDoE/gOnPeaa8VeTdcUJ9ARVjY7SquiLMz3tNse4uxetAyndEG0I438P91vbU2KjoLYAoEmK3Vv1eEziq0fQXwJO7thgkfTsdvCdfkXQjWMEugLpydRpnL5gvJcGKkvw=;20:sgzgR6VD+pPin33HRNI+r62JmDDV56nqzXLcEahbtVqQabH2gXEeKqiPiZvHoVKLF2ZMrBuTiEhcMlVj10KkIan8tnXKtXdcu8vkHgZD0M7qWT0xKVSnGmxK+Pw3X1VV1bPp1b2KF+uP/8Nve03tuLn7KJ2Gqvc2ItRi73AN7bNi9T9qeHHu4yzB67dZqmCDqC3VvbYPC8eCoIyCRv0k4JrzvO8s17Ssx+ozqam5kwTYKcWyPwTqBYCSvI9TWHWb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 00:35:03.4396 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1137 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 33 Update the cpu features to include identifying and reporting on the Secure Memory Encryption feature. Signed-off-by: Tom Lendacky --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/scattered.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index b212b86..f083ea1 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -187,6 +187,7 @@ * Reuse free bits when adding new feature flags! */ +#define X86_FEATURE_SME ( 7*32+ 0) /* AMD Secure Memory Encryption */ #define X86_FEATURE_CPB ( 7*32+ 2) /* AMD Core Performance Boost */ #define X86_FEATURE_EPB ( 7*32+ 3) /* IA32_ENERGY_PERF_BIAS support */ diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index 8cb57df..d86d9a5 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -37,6 +37,7 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c) { X86_FEATURE_HW_PSTATE, CR_EDX, 7, 0x80000007, 0 }, { X86_FEATURE_CPB, CR_EDX, 9, 0x80000007, 0 }, { X86_FEATURE_PROC_FEEDBACK, CR_EDX,11, 0x80000007, 0 }, + { X86_FEATURE_SME, CR_EAX, 0, 0x8000001f, 0 }, { 0, 0, 0, 0, 0 } };