From patchwork Fri Jun 16 18:56:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793361 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 0923E60325 for ; Fri, 16 Jun 2017 18:58:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF8582865B for ; Fri, 16 Jun 2017 18:58:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3E5528670; Fri, 16 Jun 2017 18:58:57 +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 53A9B2865B for ; Fri, 16 Jun 2017 18:58:57 +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 1dLwQQ-0005aM-3T; Fri, 16 Jun 2017 18:56:54 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwQO-0005Yw-RB for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:56:53 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 26/E5-11537-4F924495; Fri, 16 Jun 2017 18:56:52 +0000 X-Brightmail-Tracker: H4sIAAAAA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tower-31.messagelabs.com!1497639409!105882974!1 X-Originating-IP: [104.47.34.68] 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 55874 invoked from network); 16 Jun 2017 18:56:50 -0000 Received: from mail-by2nam01on0068.outbound.protection.outlook.com (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.68) by server-14.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:56:50 -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=HpH3nPeIY18wWnnVnkwdwAGUJD/dCZrqDksG1OTBmdg=; b=1urjCGO60I5yJt/uIXvlljk2EDLmbUO41iLCX2Ayj9UaPOLPPhHFFgBo4weC4Bsm8URUFjQY9FVF7cKUTZr4Y4gNj4D0AWPY+x4VJDJUKFJ0zn9H2pr3DHv84S8QbDTh/maBPnpnHnzCQMFx7mDmCTH+oqsC40145SkDdf5Z9Fo= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by BN6PR12MB1139.namprd12.prod.outlook.com (10.168.226.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Fri, 16 Jun 2017 18:56:42 +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: Fri, 16 Jun 2017 13:56:39 -0500 Message-ID: <20170616185639.18967.41488.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170616184947.18967.84890.stgit@tlendack-t1.amdoffice.net> References: <20170616184947.18967.84890.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: DM5PR19CA0014.namprd19.prod.outlook.com (10.175.226.152) To BN6PR12MB1139.namprd12.prod.outlook.com (10.168.226.141) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c88cdeee-89ad-4b52-55b3-08d4b4e96ead X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:BN6PR12MB1139; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 3:Tl+bdb0feNAbTBng+nPte2qW04i/Ji3p5bkRpw1Ia8q222dINFxL7300D0RrAF+El4Vf+w4EqoUFoo8VTzYBTEgb9cy+8vHWZszBON95yvYILhz/QM9IMgtPrjPMW4kZobSwYHAyX56Og8l3cWvzDfh6h+zgyzcq43AIiMcDZ5lJDbhFnGgy7IbMX/oc7Liwd6j9eFF6qZuxN/eYBwb60h4Oq7r5G+O9A4kS1QY1Xg4LljiSC3M8J46oEhM30iMoWchlgPFvf3mpjzVgTY3MB1nc53q5pGD0faOoopZXzboirVZcazaTe2UmOfWzF+PXAZj6gdEdmMSAFHe4RuT/s1tbGxL9l+mWxO8Civa3Vhw=; 25:Dv6PR+ETXshGyd19Mm0pnHB6W49BLAZeIGYQhQZ9Bor8WaLAoFerGwnD3NDWALXipwuhkMhSyIZiXNNcOKW57agpR8iLjAlcxkk8nbaN8NlESy3+62WWcd6RsaimTxGN2RGGf0/imsoMOidDXPPAD4rp/XOenyy2BaykeQOfmC08GqU4SCEIRmNXCfhQ8klj4aSvpiW38Y0iWfLwJ+AgDs/r8No/rZF7malmtKV+pC43QrXZVlnFXBx+lwnkgXDWjd5359oqKngIz+/BKNfIqa0Lao/vSgwJGVGZLkAVDQkGTABY+xpqfe8OnNfEl/H+Jj+7+SNl0pv5QwdnPNk3wuzOyxIN/sFO1QWC/X+XFpGk9jtT4ZAK0sdXSfDhjG61XpnCGehevyhpPcDg+HrCSUOZw1FQxaI4vfdlJ+LbjBzAKpz7Wwg3fq4JNKnFVS3rJdDbtFuEExqZwScpUAdy15Mu2O/wxp75R2ICL0ugWao= X-MS-TrafficTypeDiagnostic: BN6PR12MB1139: X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 31:mqMZJq/QykngqWJ0/Es5I0s6tsz0ot3km69u25tVfo5ErVvf1Lt0S5DAcHFokxquWpLXqBFm1+KY4xOkptvc5BUowN8mW27oR3M6Eed69A61ucbpGwz3DsULO4PsEBO+ZQ9tZjnu2zFWXHNhnESSpAkrCcOo5/1Z37lpSYfaoeI9hExLcr5cUXo1Mk8fusRL2nRPozcipyXpl3QfwRYqjzI5hKusCBF3Ngskb0sw8Qs=; 20:iQLLkps+yH+oDJeGeyUevgx+kWstRwKePBKYwQGKJY0DTpg5+rC2FLHTgP1NLAkJUwnyn1X5Rwgi/GgAHnJzp+C/VHng3Bfm8aiIRWp5zVVrNnmSbEk6xd7Rgbgo1S0TstfFy84kBge7P4GZnjOpWjHYNxrt5s0BVZ7DxL8na90mQ0Cr6ia7sem2bl1AMvYMpA/PbHBqYHyy3PQxJlXiO8hmD+41HVfVmTpM2U7uUgrlaDXz70KQtuG06fRPSpZymLf/U6OxmxnnR+ZrVN1udz1gJ+Slls6SERs2aXEibVvPgHepkVH/7s36BhI0LIWLaQmFy0qWvNHakCKEIOQ0J0RO/FmQvsP2wpjU64UarFM0l84g5ES5ExfKcAka1S13W3mURt9Q+OCMfjQZG0M9aKM5Z68ghF7xVcD7+cXmWzvXL9q3enmiGUXst/g1vSar/mMCIkT+9letaqPxByXlzbB85Xwp7IVT/u3EwlLgRwbx6yjPqkX9sCYL2qSU55qE X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1139; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1139; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM5OzQ6aEhIaXpBVFJhbUhPbFE4bVFaOVhYNXN5ODFw?= =?utf-8?B?ZXZUN2FaRU5mVE15QmUyVktWRFNyUWpwZUNMWGFFTWpQSU04dk9abDVjdVYw?= =?utf-8?B?N1gxcDgvWWRubzlnb3BaQzUyYlZ4SjBOVHRhclVnK0gzMXdoR1JpMkloOTVs?= =?utf-8?B?R3ovR0RDWGRyUlY2cWgySkNkcWYrZ0ltb1BETVVJOHg0TW1oZ0FoS3B0Q0Rr?= =?utf-8?B?ZEhuSHdUVXVEeFV1ZnErbU5sTldSUzkzVm01RXl1emUzaEI0Ym9CM1B0WDNy?= =?utf-8?B?UzZ0U084bGRVNG9sZ0dvZE9XZkNaVUlNSXBSQXNSRDRHOVg5YkI1MHNZc2Yz?= =?utf-8?B?SEovWFIyT1FoSWVRaU1IQy9iK1dxQ1VubG1uSFoya0xXdk1xRjRQcUtUQjJ6?= =?utf-8?B?L29XOEp5enR4aFFYMGt0ckxOdnUwbmV3V1VjSDVUMGhSZ2UzLytCWkx6bHVo?= =?utf-8?B?cW15aVlpZW9JRU14ZnFpUFRVN1p5bDVUb080RXkrdVlsS21PbDM3KzJUTTg3?= =?utf-8?B?ZWduYS9KK2xqamtvcGZmU2t5WUg2MkNGdndHZlZkTjVOZExobUtNa216Q05h?= =?utf-8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XIyNXVmRjZGOU85cVp5?= =?utf-8?B?Y2RHa2VTclNJcTJYeldHVzNmQ3lpc2FvdDlZc2hLMVArTDJ3WGo2cWZGakRm?= =?utf-8?B?N1VDNE5DVk44ME5kUGU2NVczckNJWDNsdnFwcXNLQVhGdDFoT2F3N3VTbDhV?= =?utf-8?Q?eyxf4RTGxqMoy7/ngAD?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39400400002)(39450400003)(39860400002)(39850400002)(39840400002)(7736002)(42186005)(6666003)(47776003)(4001350100001)(66066001)(54356999)(7406005)(8676002)(81166006)(2950100002)(83506001)(50986999)(5660300001)(53416004)(305945005)(189998001)(25786009)(33646002)(2906002)(7416002)(110136004)(38730400002)(53936002)(54906002)(4326008)(9686003)(76176999)(50466002)(478600001)(86362001)(72206003)(3846002)(1076002)(6506006)(6116002)(23676002)(230700001)(55016002)(103116003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1139; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM5OzIzOncxalE5UWJzWnZCczA1ektJRlA4Zm83UXRy?= =?utf-8?B?WXA5Wkk3bTZFd0NMOUQrUVd4YnRETXB5TXdNSFovb0Z5L2h4N2hlM1hScWll?= =?utf-8?B?djNnc2JsVk51bDlsS2k3NC8zMDB2cjVIYTFNbUh0S2NNUG54UHcyczRWYzRX?= =?utf-8?B?SzdiT2RCbm83bEIvcE9SY2trWUlkVndnTWdzZWtPcUtVRGRjYXpSdFpOR0N4?= =?utf-8?B?b2RPRkdQaDl2bU5uOWo5a0ttQmFhVXlkUWlEMUJ4U1gxZFgyZDZMck5Va0Nr?= =?utf-8?B?eEs2V1NNc3A0QnA0UXErQUkzZ3NkWGRPTWM2U3M0aWhlaHk1OEJiakg3WTZv?= =?utf-8?B?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crQVF1aFR1U2ttRmhIUjZzQUVoZjl5RmVWTHZvR3NB?= =?utf-8?Q?we7aEGq?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 5:D8+JBrV/glVGAu6zH0SGrhR080MbfflL15nnZu9yVp/C4353ab4z6ap0uz7OsT4RdwtHRNccD4OrFutlp97xLaz2TBjqp/h8REO/PqoQBhKmMl1pqytcF55c/Z3bxpGele1OOdiypq9g3HwyeMNNMaH33ZUmFnZCMafAXsrWTjNLa0/erHNs2yKxeXAtYz9/byIznXuqYNitHlEy37lvaodNgjfHbDBeclB3xubrrJJK5Z+6NBqPwB3VAGhFgbRrQw2jmXx2lyXOa7RG7Bpj+PJ+s4rzNQS/AtwuM//N7Yj5s23iZxOzrAM/uu40yytBSDOBq7lnpHH8Yi7FEbHDtXjvYqAPEBlTGkZpRlJvtYln7xyKZ/0chgHiV2DsStrIOzm4xZzmwGbRcGmgLwl59UBKZXh5zd6ElX5qaGKj0ohvXPw4pzauCAGRdpP9l6QZ/5xEr1OrfpzqVGUQQl2cqFRFZT3Htc8YnrrgJsonx4wM9ooKnRs84gGR+L2YiDZz; 24:BTA585h2Fu3dCwv5Ppuw/5VXqNbQT355L+2gTLrmcHn4A46i+gCE7jKemPlGYlK73ejvUcHc69OP2wsvM1HSBi6lKedNPSRO1zRtt3kb+1o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 7:90hZHI3MNttCcGfoLurXvBBQDU+h0BOI/ASGo3L4kXCs55M7Hknl5JxppR+q11bIoCDqzi84RekSC/wFLqHxG8zTZrsegoVHCeV2ngycDnocLvL5mphRfCi8J3ToYTW3gNDZxlWf6xvhAf9Wzu8/jgC6qIoJHISCslfWKNtuq9XrFnJOnAdvFG2sj74pImG0UkrKe8DfjtedANsub9o4m3uaZtAXpwu44EldUiTJ5RC08LkgBs9fY+BZYs3g3Ih2dsGVYRVH9en3hBhbqR+bz4fhi0ElE9WPJcAZOef1SbPFUj4Tmfg9+0T/YLy8R4xAfksysYsqYatQMnN59wm65FsGEIrSHi40tr4c7oLvGacqyRW9Owxai/5g4x726Ak7RKYJH9UyD18Yi6LCpzAoyVreggmz/+xQF1ov6zmUAuDrLf4cI6QDWum5fEa09mwcHnB92vI9es6qI4P3hI7srPsclCCYBH9w0+qgGRwFVuxnIXmmyXd/nTceERZNl1qhikZermzhTXzFgeQc1FwVSBmb+Uk+sU0eTTYrqpefUBCbVgoXtWzR2689YirZAnJcsS3JDO+KShgdLZoh/sOtXunrTx1M+PgnAbaNnGPiOodWfcJFJoA3DH8ZGqnqe3NBe4kSiXvL8ThMc+8aCSTSEJQDeTNLgCSTBw6dc8T6SPO9HOvQj9ea56flXeXodKMV9dmhP9PtI66ISx6XAkGZ0jR/47MU5h5rgloOLxK8X93A27Qee84+OzGrJ4O5/+1S2fIPjS3DgGIZMLST9qmiFzjDhPIDBM+GIIAd3qvriEg= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1139; 20:HikGWWY+osw9n2BIeVRLchELFdcHjGr0fkvXVbBNWp3EZVkUDIKCUvHEzJReKvwYWhTljJGeS76I9IsorgnCcljsl8RPDdondCDX7qxd7zv5yt+HNjOK0n8zhPbRy5wrruh8/XyYkYA23K67eqIs6mDcTVIgBL/WjE3fi+nu/r6H5n7ccMR/cLaMuyLkKh0IO6oTwegQuxejCQCS0/548ax5oLtRYsMjcQzj0f5wozuSfl91+yrd+fq0IiGAUqot X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:56:42.1284 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1139 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 v7 36/36] 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 | 4 +- arch/x86/mm/mem_encrypt.c | 86 +++++++++++++++++++++++++++++++++++- 3 files changed, 90 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index 7da6de3..aac9ed9 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; @@ -37,7 +39,7 @@ void __init sme_early_decrypt(resource_size_t paddr, void __init sme_early_init(void); -void __init sme_enable(void); +void __init sme_enable(struct boot_params *bp); /* Architecture __weak replacement functions */ void __init mem_encrypt_init(void); @@ -58,7 +60,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_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 9e94ed2..1ff2e98 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -43,7 +43,7 @@ static void __init *fixup_pointer(void *ptr, unsigned long physaddr) return ptr - (void *)_text + (void *)physaddr; } -void __init __startup_64(unsigned long physaddr) +void __init __startup_64(unsigned long physaddr, struct boot_params *bp) { unsigned long load_delta, *p; unsigned long pgtable_flags; @@ -68,7 +68,7 @@ void __init __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 6e87662..13f780e 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -13,19 +13,34 @@ #include #include +#include + #ifdef CONFIG_AMD_MEM_ENCRYPT #include #include #include +#include #include #include #include -#include #include #include #include +#include +#include +#include + +/* + * Some SME functions run very early causing issues with the stack-protector + * support. Provide a way to turn off this support on a per-function basis. + */ +#define SME_NOSTACKP __attribute__((__optimize__("no-stack-protector"))) + +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 @@ -200,6 +215,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) @@ -527,8 +544,73 @@ void __init sme_encrypt_kernel(void) native_write_cr3(__native_read_cr3()); } -void __init sme_enable(void) +void __init SME_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)) == 0) + sme_me_mask = me_mask; + else if (strncmp(buffer, cmdline_off, sizeof(buffer)) == 0) + sme_me_mask = 0; + else + sme_me_mask = active_by_default ? me_mask : 0; } unsigned long sme_get_me_mask(void)