From patchwork Tue Jun 27 15:14:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812529 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 BA24D603D7 for ; Tue, 27 Jun 2017 15:17:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA837286BC for ; Tue, 27 Jun 2017 15:17:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C53B286CF; Tue, 27 Jun 2017 15:17:11 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 08047286BC for ; Tue, 27 Jun 2017 15:17:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPsCj-0003uB-RE; Tue, 27 Jun 2017 15:15:01 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPsCi-0003sq-Mb for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:15:00 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id DA/2F-03620-47672595; Tue, 27 Jun 2017 15:15:00 +0000 X-Brightmail-Tracker: H4sIAAAAAA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s.com!1498576496!104227288!1 X-Originating-IP: [104.47.34.63] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41524 invoked from network); 27 Jun 2017 15:14:58 -0000 Received: from mail-by2nam01on0063.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.63) by server-5.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:14:58 -0000 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=tyiv9e6h7oBcQg9shnkfBL26rUn0KAyG5QUspnbXnec=; b=XkOi6hI66KwCvvRadC5/utgCb3CWH/TJpgXL46PSVC+9A34tWZpWyltv0Soz5SksK749QvGynLU9+7iBZ9VEnh5RwOgowVEymQR2IzicRQZySdh682Ev6hdyFbfgVB9EXoqqC/gOVxC5PyYE8JR8rBglRG+gxyRLKUeg4M/Fgo4= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by CY4PR12MB1144.namprd12.prod.outlook.com (10.168.164.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Tue, 27 Jun 2017 15:14:51 +0000 From: Tom Lendacky To: linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, xen-devel@lists.xen.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org Date: Tue, 27 Jun 2017 10:14:48 -0500 Message-ID: <20170627151447.17428.56826.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170627150718.17428.81813.stgit@tlendack-t1.amdoffice.net> References: <20170627150718.17428.81813.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR11CA0023.namprd11.prod.outlook.com (10.172.17.33) To CY4PR12MB1144.namprd12.prod.outlook.com (10.168.164.136) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 96b7d2c9-f149-481f-e336-08d4bd6f445b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095); SRVR:CY4PR12MB1144; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1144; 3:2CYy+8FgcBH4kOHFcWXv1xccmgkq3jtRZNorGNfHE1W+dAnA8Nxc/J9DvV/h2oUkoUxT0+0QBYFt0WiGGuVUBHZwscxHJ7TSVHrIFp1bdQkPlXVXGpgX7l90DCk+Bk/EtmnuwUskNqrjkaNeeuGQyNcQ7zPJDPqHYR1j2mWaqTAaFnSOTFHS34EmeLIIgigVVMy20b8NwbUGt4pJGeCwtqAOBvvTAaqfum/k37bZrZsjvYU9GiiENZr7LRO90PK57uRwX0l/LX518m5eJxzwjyOAdPkrOcVscZ+6YW9hjSmawmDAABby1l3m9r9KSbsWZYIdeLXbQgStTIivI0R2Ag0EajKeOsbzxlUY4SIkwDDbThY8y10tJhMdl/M05CMTlzPRzkwMDTEAIt1GG8eqepUxXTFkaQanp6A8oGVTQz0ltXyGg+3md0lPIR/12M1s1pQwYRdoY3heXbBCqaPV4sJ9gtHSHTQmSUERiOHASZcSSshssNk/S0CgHOczn4KIkya0OEyfjJDEcwMUYkXIIa+Qo+rLZOiIThGzFtkub06LhnU6la9mqtVoZLW6Ep5WNv4kZ/yst7ZJ5TRzURpueptIlGL6Jb9oFnTJ0fyFPrDQTUeEN6PESseAXvsCJR4+u0Nm3eZyF3KORA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8A+mrYe8MoDTQxlRHsVRjeAJltlyZWAulp0Hk96JIckGGdN+5rNFkIFYhdA9bI5wqPdawMjqQCuDO78gussYgzEMYhZ7BQLkHIEk6NSsK/00unaxWsNhXxc6QxCU4KIwxvKb7GYmiqEL6YEaZwS3nBJS7QgYPX7Rbpw38UBuziJxyIelYUIbXdCGmyPf+K0iJCoJyQX0nJEV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(125551606395959)(133145235818549)(236129657087228)(767451399110)(167848164394848); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1144; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1144; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQ0OzQ6dElBZnd0RDV6VU52YTJzdkVYK1FkdG1MZFpT?= =?utf-8?B?aTF4dWlSUDBueG9OQUFneFlxMmI0WlNLd3duR3kySlBaNExhZkZGM0VKcStS?= =?utf-8?B?Lzd5R3R4Q2dwekh4cFg4bEQ1bGRQNytON3NOQVJyRzJmUFdGTjBLMWw1NlF0?= =?utf-8?B?Q0xtRTBkY2JVQXloV1ZWZFN0NFFuWmZDa0VnMkp1ZWI4UEFrYkZBUnRNd21H?= =?utf-8?B?OEEyelZMcUNOdGxjcTg1NDNvdzNMTjJvSXNHYWI1SEg2dkdLSWRlMWljemw1?= =?utf-8?B?aW1xZkM4djdIMllGQlNtUURMST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NHd1R3g1YTY0cEI2WkhzdW1veUVHQWNieEhTSlVDd3F2c0YzWmdJ?= =?utf-8?B?bzJJWVVwM1V2QVFKUlJvOGlhVDNXb1doem9IMGVXeDd0Nnd6QW9xRXJMZW44?= =?utf-8?B?WTNZR293eVNidHZvaEZxa0hZbWtxdGNlVzdKNTBRRzQzU09Hczk3ZWttRzlE?= =?utf-8?B?TUdvWElJVlRTQ0V0Z0hXRmlEYk5vckVwdisyRzArQ3VKeWVXU05tQWhGcm5K?= =?utf-8?B?U2d4Y2YybWlvNmk3MGVZTzkzVG9hUjRuRGJNb2Vmbm4rckpqOE1TVVgvNndV?= =?utf-8?B?bjAyMXFHWUFFUm41Q0ExNmg2NU0wSkJzLzFMbStYMGVFNWtNWjJFcExLS3Vv?= =?utf-8?B?NHVaaklaWTRjMVhDcCtlSTZzWFdyaENUSzlOWVZlVDVES0I2aWJ4TmVlVUdz?= =?utf-8?B?Z3JEbEJCeGFMUXFhd2VuQWM1anlSNlpNR0dSallqV21uMDNQNzQ1eFYvb0x6?= =?utf-8?B?aTQxVXNGVDVrMmE5bWNWZkRERU5pQVFONnlqRExEUnpHZ1dYSXo3WTZ0OEtQ?= =?utf-8?B?bW1yUmxsdWpLS2oxLzlaVE9SQ1M3Vi9XMjRJcUwyZ2cwa0xldWxOZ3paQU5Q?= =?utf-8?Q?WuKpx+3kBtM2?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39400400002)(39860400002)(39850400002)(39450400003)(39840400002)(4326008)(25786009)(76176999)(8676002)(4001350100001)(2906002)(478600001)(97746001)(50986999)(305945005)(6666003)(2950100002)(23676002)(54356999)(5660300001)(53936002)(86362001)(7736002)(7416002)(7406005)(110136004)(189998001)(47776003)(66066001)(38730400002)(50466002)(53416004)(42186005)(9686003)(103116003)(6506006)(83506001)(54906002)(55016002)(3846002)(81166006)(72206003)(230700001)(33646002)(6116002)(1076002)(921003)(1121003);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dnvRnlY97pEck3ZoDNgv3Pu38gx+ZLl8DBy/Id1djYcqOTwqTG/FsRDO3S6e30lIc/9ET+XDtDMjVNZA= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1144; 20:0o32JwWMuBf2rgujQMjaU/eGJbBB91B3jJgyQi+XkCMrIIASVGNKb0RFE/+bBq6bi5VADEMJtjq8uxzYkaTR9xlxyRhaC07yO4JXqxZLmvFCO2JFzZ4H/MnjkkT3lpTqQGmtZPXgyceu84cGYpRCdvhBBO2u4gmz73AFOp/FGVgrFO206+Q9/SG4AEZBY/yRoryl4ep2s00NZyPblShNXAbloqJ5Z6LLihFxx7MutbqUG6Uc07j9sgZh7urmQPJn X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:14:51.8537 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1144 Cc: Brijesh Singh , Toshimitsu Kani , "Michael S. Tsirkin" , Matt Fleming , Alexander Potapenko , "H. Peter Anvin" , Boris Ostrovsky , Jonathan Corbet , Joerg Roedel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Larry Woodman , Ingo Molnar , Andrey Ryabinin , Dave Young , Rik van Riel , Arnd Bergmann , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Dmitry Vyukov , Juergen Gross , Paolo Bonzini Subject: [Xen-devel] [PATCH v8 RESEND 38/38] x86/mm: Add support to make use of Secure Memory Encryption X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add support to check if SME has been enabled and if memory encryption should be activated (checking of command line option based on the configuration of the default state). If memory encryption is to be activated, then the encryption mask is set and the kernel is encrypted "in place." Signed-off-by: Tom Lendacky --- arch/x86/include/asm/mem_encrypt.h | 6 ++- arch/x86/kernel/head64.c | 5 +- arch/x86/mm/mem_encrypt.c | 77 ++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index 7122c36..8e618fc 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -17,6 +17,8 @@ #include +#include + #ifdef CONFIG_AMD_MEM_ENCRYPT extern unsigned long sme_me_mask; @@ -38,7 +40,7 @@ void __init sme_early_decrypt(resource_size_t paddr, void __init sme_early_init(void); void __init sme_encrypt_kernel(void); -void __init sme_enable(void); +void __init sme_enable(struct boot_params *bp); /* Architecture __weak replacement functions */ void __init mem_encrypt_init(void); @@ -60,7 +62,7 @@ static inline void __init sme_unmap_bootdata(char *real_mode_data) { } static inline void __init sme_early_init(void) { } static inline void __init sme_encrypt_kernel(void) { } -static inline void __init sme_enable(void) { } +static inline void __init sme_enable(struct boot_params *bp) { } #endif /* CONFIG_AMD_MEM_ENCRYPT */ diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 0cdb53b..925b292 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -45,7 +45,8 @@ static void __head *fixup_pointer(void *ptr, unsigned long physaddr) return ptr - (void *)_text + (void *)physaddr; } -unsigned long __head __startup_64(unsigned long physaddr) +unsigned long __head __startup_64(unsigned long physaddr, + struct boot_params *bp) { unsigned long load_delta, *p; unsigned long pgtable_flags; @@ -70,7 +71,7 @@ unsigned long __head __startup_64(unsigned long physaddr) for (;;); /* Activate Secure Memory Encryption (SME) if supported and enabled */ - sme_enable(); + sme_enable(bp); /* Include the SME encryption mask in the fixup value */ load_delta += sme_get_me_mask(); diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index e5d5439..053d540 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -23,6 +24,13 @@ #include #include #include +#include +#include +#include + +static char sme_cmdline_arg[] __initdata = "mem_encrypt"; +static char sme_cmdline_on[] __initdata = "on"; +static char sme_cmdline_off[] __initdata = "off"; /* * Since SME related variables are set early in the boot process they must @@ -190,6 +198,8 @@ void __init mem_encrypt_init(void) /* Call into SWIOTLB to update the SWIOTLB DMA buffers */ swiotlb_update_mem_attributes(); + + pr_info("AMD Secure Memory Encryption (SME) active\n"); } void swiotlb_set_mem_attributes(void *vaddr, unsigned long size) @@ -513,6 +523,71 @@ void __init sme_encrypt_kernel(void) native_write_cr3(__native_read_cr3()); } -void __init sme_enable(void) +void __init __nostackp sme_enable(struct boot_params *bp) { + const char *cmdline_ptr, *cmdline_arg, *cmdline_on, *cmdline_off; + unsigned int eax, ebx, ecx, edx; + bool active_by_default; + unsigned long me_mask; + char buffer[16]; + u64 msr; + + /* Check for the SME support leaf */ + eax = 0x80000000; + ecx = 0; + native_cpuid(&eax, &ebx, &ecx, &edx); + if (eax < 0x8000001f) + return; + + /* + * Check for the SME feature: + * CPUID Fn8000_001F[EAX] - Bit 0 + * Secure Memory Encryption support + * CPUID Fn8000_001F[EBX] - Bits 5:0 + * Pagetable bit position used to indicate encryption + */ + eax = 0x8000001f; + ecx = 0; + native_cpuid(&eax, &ebx, &ecx, &edx); + if (!(eax & 1)) + return; + + me_mask = 1UL << (ebx & 0x3f); + + /* Check if SME is enabled */ + msr = __rdmsr(MSR_K8_SYSCFG); + if (!(msr & MSR_K8_SYSCFG_MEM_ENCRYPT)) + return; + + /* + * Fixups have not been applied to phys_base yet and we're running + * identity mapped, so we must obtain the address to the SME command + * line argument data using rip-relative addressing. + */ + asm ("lea sme_cmdline_arg(%%rip), %0" + : "=r" (cmdline_arg) + : "p" (sme_cmdline_arg)); + asm ("lea sme_cmdline_on(%%rip), %0" + : "=r" (cmdline_on) + : "p" (sme_cmdline_on)); + asm ("lea sme_cmdline_off(%%rip), %0" + : "=r" (cmdline_off) + : "p" (sme_cmdline_off)); + + if (IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT)) + active_by_default = true; + else + active_by_default = false; + + cmdline_ptr = (const char *)((u64)bp->hdr.cmd_line_ptr | + ((u64)bp->ext_cmd_line_ptr << 32)); + + cmdline_find_option(cmdline_ptr, cmdline_arg, buffer, sizeof(buffer)); + + if (!strncmp(buffer, cmdline_on, sizeof(buffer))) + sme_me_mask = me_mask; + else if (!strncmp(buffer, cmdline_off, sizeof(buffer))) + sme_me_mask = 0; + else + sme_me_mask = active_by_default ? me_mask : 0; }