From patchwork Fri Jul 7 13:45:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9830455 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 7D582602CA for ; Fri, 7 Jul 2017 13:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0563D28514 for ; Fri, 7 Jul 2017 13:47:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED070285EB; Fri, 7 Jul 2017 13:47:22 +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 4605D28514 for ; Fri, 7 Jul 2017 13:47:22 +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 1dTTZV-000700-5m; Fri, 07 Jul 2017 13:45:25 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTTZT-0006y0-QY for xen-devel@lists.xen.org; Fri, 07 Jul 2017 13:45:24 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id AB/01-01987-3709F595; Fri, 07 Jul 2017 13:45:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmk+JIrShJLcpLzFFi42LJ0Nd00S2cEB9 pcHmOnsWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmjG31aPgm1bFoc3TmRoYW1S6GDk5WARamCW2 /jHuYuTiYBSYzCix9vokZhBHSKCVSeLzky9MIFVsAjoS195C2MICYRL3Z11lA7FFBBYwSTyaJ gDSwCzwlk1i37kzYAkmARmJBYuWMkOsUJW4v+8TUDMHB6+Ah8S0Y4YgYU4gc8+aT+wgtpCAu8 TP44vAWkUF5CRWXm5hBbF5BQQlTs58wgLSyiygKbF+lz5ImFlAXmL72zlg0yUEFCS2f//OBnK ChEA7o8SqD9uhZqpIzPp8gR2iSFbi6Nk5LBC2r8TSK91g50gIKEucavGDCB9kkrixRRtizlk2 iWW3fkL1akm867sDteARu8T3SROgBj1ilZh6JwAisY1F4tiZNVAdORILJjyFOq9WYsO2v6wQ9 m1WiaYN0hANm4QkXq74zDSBUXcWkk9nIXw6C8mnCxiZVzFqFKcWlaUW6Rqa6yUVZaZnlOQmZu boGhoY6+WmFhcnpqfmJCYV6yXn525iBKYIBiDYwfjytOchRkkOJiVR3jc+8ZFCfEn5KZUZicU Z8UWlOanFhxjVOTgEFh1tCpZiycvPS1WS4LXtByoTLEpNT61Iy8wBpjCYSgkOHiURXvcOoDRv cUFibnFmOkTqFKOilDhvDEifAEgiozQPrg2WNi8xykoJ8zIC3STEU5BalJtZgir/ilGcg1FJm FcJZApPZl4J3PRXQIuZgBYrNsaALC5JREhJNTDe+vLto0WV08L7WlEVHdMzF5/2/SL2akVM3b VNEh7Toz5qfjFWmNfxQnP3J/EuuZdKzdxm56V2qZv6Tj9vfk3jml9EzgXN9N9RIYX29ww2m1v 66RtoLXIuXsew4ajhoVVh0ULnnvcoX7NW6u76M8Gud93CRyq2B6w7bnko+2SdMbRaxbmylE2J pTgj0VCLuag4EQBO0WDTlgMAAA== X-Env-Sender: Thomas.Lendacky@amd.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1499435120!65873812!1 X-Originating-IP: [104.47.41.68] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9004 invoked from network); 7 Jul 2017 13:45:21 -0000 Received: from mail-dm3nam03on0068.outbound.protection.outlook.com (HELO NAM03-DM3-obe.outbound.protection.outlook.com) (104.47.41.68) by server-6.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 7 Jul 2017 13:45:21 -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=nAVDfTeYXFJTJlU0ElYARkzNOytDEBM5doc6JRVl7poVgv+2qfElDJO69Nm1jN3MWC9EuB/itJDLfJ4xzH0FVx5k2kZY3BmDMU7Ha7j6BRZ0XWy8GIN0/GHfVbSoJyFZYxS9xt0IPKKOcuRLvfIu8wod6dbC3IXKRIyu3DlBnu8= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by DM5PR12MB1145.namprd12.prod.outlook.com (10.168.236.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Fri, 7 Jul 2017 13:45:16 +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, 07 Jul 2017 08:45:13 -0500 Message-ID: <20170707134513.29711.90550.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170707133804.29711.1616.stgit@tlendack-t1.amdoffice.net> References: <20170707133804.29711.1616.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: MWHPR22CA0055.namprd22.prod.outlook.com (10.171.142.17) To DM5PR12MB1145.namprd12.prod.outlook.com (10.168.236.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9429151c-5597-4034-4217-08d4c53e6867 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)(300000506095)(300135500095); SRVR:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1145; 3:0rEeb6kZt/YaetEXj9jZsxWTStP+fwaGYkGQaeZP1RAbqygGE24aDKKFiO7o3k0DEsjtXcJW9lYNrnwmOIOG3dxWxwOnKiRwapGL9EiuDF+4gDwhmJGSMjv2qmLxRUHBf0ZwrKMuc01OShAB+RiqV+jN42lS4fGk8dJL/IXntWdV1RTq2slxE3pR2fJ3J/Ze6ZkDzPM8ZXwlzYhz80Immw1xY4ds5l0n9dSCzweMn5WocVs4DX09c4apZ71FvZ44okU4aTc+7j5C3JtGmqJ5Z6i04m6y7rmtsCmVLrNaY3gZDZeKfnbw5ko8hII5kDG7Oa77ve1PRYUs+o7M5brAbdsSjl1lLpPxgpPUbvTc+So3xjlPQY/AEaKKAzxsAr6400cRTx/R4ESiHlFwrdXyFG+kJJO9xQqfv9Sv9dkcecizy33stdNH0wsYWTCRQbe/bYGkOMu4o60M1/26vOppdW2CV9g4X5vd1ES7DRQT+mS5g/Aw1NH0FfSJAfXOumsPa0QIh5IPvyrG+Vr05GC9e6aXuaKZ2sfdg+Rscxlrah6XeMwWU0GMcUvJWp01aqz/O+iheASZcAozLz7RtLMsyP+E2nnHcFDjmGyFIB4n6ySIAfDonC7vA1yGFoCUnuRBPV3Ipy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7V3dSyopWVY8JCk2jlaSNxAPhIX6wXjxXJgu6K3hEcQ5VQX6vxIlPzC+oVND6MCyxV9Iz91j1lCoFfjN8u6/DfeV9zdTmDx3ArZmdWCWPoNcUrKp2QMylkNZB22vuFG3zCeNjqiA8KJs1oIRyUi31QlkdotLuuVC/I2vsmdocO5Ahmogy2Eqa7BQEBrd4+KtHGSswaf1T6XuN3e1RP3oCaQScNeAYjHjtdXWWHIfBHSeNhaRX85XQpCtWQsP7gHB6YDS5Kcn9nvjHh1vfsJU2Uit8wm 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)(2017060910064)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1145; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1145; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ1OzQ6c2RhM3FhbmxTVWtDdzF5YnJuTHJUWEtrNkxa?= =?utf-8?B?OE1aQ0RaNm91dFZVYjlNTFRNbHJPWG0reXFUZ1BrLzhuSnBHZG90VWdWTHlM?= =?utf-8?B?Tk1IeEcxekkwUHNyTmpxbUpBdTBvc2lqMEIvdkJTam9LMTNKRXRRUEJHdEFs?= =?utf-8?B?RGpocEE2U0hsL01KZk12YkxFTFliYVVJNGo3aFNLU2o3amoxOWZacDJ2WXNW?= =?utf-8?B?V05l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d3ZhN3Ey?= =?utf-8?B?Q3pxY2V3OS9IeWlrOHd0Z1Fsam93VjlrWmpGNnhMUjF5dDl2QVo2OHpRYTc4?= =?utf-8?B?MEhCVklZU1BKcHRYYlhPelpJYXNVQlhaREkyZ3MzR1NROE5ldFlzMXlRSXVl?= =?utf-8?B?RWZwenkwc0RJM1QzNk96bDJBZHpKVlgreHBTZXVKNUhGdDhTK1VlMkVaejNn?= =?utf-8?B?RUo5MWVETFJ2MFM0VHRzQ0hBU1lVNGFiaXNkLzVhTFVEdGtlUC81OE5NZ1hu?= =?utf-8?B?VFNhNFA4MUpUNVkvbHR4bkxiSHE1by8rUzRzYXcrVTBOTE50T0pZT2NWc21w?= =?utf-8?B?c016V2NTU3FSQW12N0FPM2ZRMkJiNkNBWWxCS1hoeU1MYnRESHVBazRZbFBj?= =?utf-8?B?QnpiUnNhb1ZlVWcwODViUkdOUTZGNHUvUzJRMlErV2NzbzdqTDhUT3NFZ1dT?= =?utf-8?B?UEtGenRnRTNRWFFrYWhleXNBTmVjamRQR2FORTVUQVFwbklXQ21tR2Exazlh?= =?utf-8?B?dFJmS0Jqd2hhUUhjSzhhSVlqa29PcGgwK21ZM3habEkyekZzclE2OGNsdDFG?= =?utf-8?B?U1pxYVBhRkgzUWRacTJ6MUNJcWlWejlNR2ppbVpsQ1dsSGV6a1pKSlc5bnlh?= =?utf-8?B?bERzWDBZTlNSNGRteHZTNlpBL1hFenIzKzhMeGFxci9BMlhIaTArcUhUNDJa?= =?utf-8?B?c21oaXV1YVhyR3Y4bWZBYnJmYVpQZk9JZm8zZUliTlNXM0lPZnBNbGtGK0Vx?= =?utf-8?Q?JTLG8oybxo=3D?= X-Forefront-PRVS: 0361212EA8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39840400002)(39450400003)(39410400002)(39400400002)(39850400002)(6116002)(103116003)(76176999)(6666003)(305945005)(3846002)(1076002)(66066001)(47776003)(6506006)(50986999)(38730400002)(81166006)(33646002)(72206003)(83506001)(478600001)(7406005)(54356999)(9686003)(53936002)(110136004)(7736002)(8676002)(7416002)(97746001)(86362001)(5660300001)(54906002)(2950100002)(55016002)(230700001)(189998001)(4326008)(50466002)(25786009)(42186005)(2906002)(53416004)(23676002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1145; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ1OzIzOkxsV2RrdG5mZEg4UUVhNFQ0TEhHdzhPaE9p?= =?utf-8?B?NmUwdzZmUjVCbkJVOVI2c04yWHJDYys4cWcrUUNQUk11WCswb3p5RFR4VnNQ?= =?utf-8?B?bEx4OXlNbGtEa2lIMU9ETEVIeTFSQjQzWU55OE9PWStKSTBkVUducHRGSkpy?= =?utf-8?B?N1ZqN0pOd1M1WnpjZlRvWmZSSG14dHRrV04xNWZMc0hHdkFNTk4vSUI4dXVi?= =?utf-8?B?elAySVh3MW9vQTVHd004MXRSajRUQmhNUHdPN1JxbTZlbW03UkxaaERkVHAw?= =?utf-8?B?MlZONS9MT1VkSlFrVnF2aG9aa2FmWGk2TTAxK1BJOVp3bXlKWlBaaVdkS3hL?= =?utf-8?B?eWcrc1RMQXp4ZEZ3TjVlUGl6KzluZXNyRDdCam1Ub2NIQ1Q4emZ2dW4yVWVQ?= =?utf-8?B?MSt4Vi9LMW1zckk4SFJ0aG1pWWEwTmpsOCtBazJFYVlRR2ZIQktGQnRvV25Y?= =?utf-8?B?cGRGYkFFQUlLak5NZWZObEQ5Ky9ZZHRjd0U1UmNWTGEwcUN2ckxwNEFMWjE4?= =?utf-8?B?TTR3cG1SbmxFbWIxVndmazBRZlVabVBCK05ITjExU3RNSUgzdWwzSktCT0FD?= =?utf-8?B?MmlDbU9jVkdQZEVqK0dMQVNrdURYQXhsbzU1UjkrZWlSN3hmSW55NjlLWnBs?= =?utf-8?B?UXVB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NFFql2bmITL7qqoYlpZlNh+8r32p8ASZ+RmT4XVR1Emxgh3ymIJLvx08VC/qscalae8zH9grg2spQHlwbM8sBS/IcEOSFUkhUWmkCWWhtK9wZRmvcNJfhTxL9CMgmjSvnQEA+SBeSkSpqP0o050rVLLteztuc5hoyVFITC8FWXSx5gfzVg= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1145; 20:y8zIif7PAloWwcf4MGtSVXsbAKNUX7WBMJJ1PZGqp7j83RRm4UU1Ev01Dl80GYnmS+6SHwyp6+L0zPOJRWdOuCJ62a1g5bTFhsith08KQLz/qbBc0T2e9NDg3EL+q7cqf/OaX0q8mDHtY48/WpeArH4YMReio8p/lQq0OgnYBNe4t0fkx5UQMUNl5AQxwmPvnXDDk9luWQ94/ZtQ9IdOMVJkcRiQQiz+BsRwU4JGvND1A9LtEuYQ1U1jdJCdR6fF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:45:16.3355 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1145 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 v9 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; }