From patchwork Tue Jun 27 15:08:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812387 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 600D360351 for ; Tue, 27 Jun 2017 15:11:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 522F0286BE for ; Tue, 27 Jun 2017 15:11:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 44B8A286C1; Tue, 27 Jun 2017 15:11:05 +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 73729286D1 for ; Tue, 27 Jun 2017 15:11:04 +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 1dPs6r-0007ob-Sa; Tue, 27 Jun 2017 15:08:57 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPs6p-0007nC-Qz for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:08:56 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 41/F8-01994-70572595; Tue, 27 Jun 2017 15:08:55 +0000 X-Brightmail-Tracker: H4sIAAAAA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g-Ref: server-8.tower-31.messagelabs.com!1498576132!107693356!1 X-Originating-IP: [104.47.38.81] 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 63442 invoked from network); 27 Jun 2017 15:08:53 -0000 Received: from mail-bl2nam02on0081.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) (104.47.38.81) by server-8.tower-31.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:08:53 -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=+suR0f3QJrs6nnkyh+5+qoNt3tgFdQL474fdMdtI9A8=; b=HSm4oaAAkt0XT/4kFyajCxxSrYWaz3B4d7gtPHHMVoQvGJBL1xRE2IgV8LtXTDH2uFUonnwrZ5+KzvNbmYCj4o6iZYKnn0DedOlkUMETnXIJwWYf+RsFnJM4eJ8YEs6qzm/CzFDjO7jsfV5+PVCI8RvN0CWs1Z5w8ceDoaZJDzg= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1152.namprd12.prod.outlook.com (10.169.204.16) 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:08:47 +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:08:43 -0500 Message-ID: <20170627150843.17428.77939.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: MWHPR21CA0068.namprd21.prod.outlook.com (10.172.93.158) To MWHPR12MB1152.namprd12.prod.outlook.com (10.169.204.16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7db24c3-7fa4-41f4-cda8-08d4bd6e6a72 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:MWHPR12MB1152; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1152; 3:evt391PA7LLGKjodR9/br6rKuPjHEEkneka1UHWAcvTsTl1xt3HB1mZipbj96KN4ZgBLCxfo8C/NoB5MGynsTCrV4aCfxqiwvpa0+Sa4sF9fcTeeElAdexpK4gsmYoPNflSbZUGsH+Vhcn5X+Wmq5I9Iq4hkDJWJOxDha/ZK81lcT3ntBi9lXf+rCuMc1RUYt8p1YoaFndFJHN/EKOG9/TrquWT58OSkeKbeZ94oQCwQQ7FIsfTJ3BZ1u9b5RnoFTxI4po4kQrHfVEJFXvIf/CKG2KEd1dV1Ctsj7+kHfEYZJnUqbMc/O3NkFJv5Zh9+djbOwCK1nD2SMbTzCAVmoiJQP46M9GJNEod8CxOCszCT0ZElAt+Zo1mw4iW8mdwLE86nSuDuk9+uMYJa3senK94FVckWtIXJ78tz075UzfKp30pVegKaVnPL0bf5MKog7O1YLtTAIb3PKozG39rDxObpp3Pt/WsClr27ht7+v8jm0n561MpBMGctWd0ZRFNDFkol5LZ961r4S5izz23aYRwkZuM3t40C+lbGBJtvXK5BxGUwPYJiwsfM7tObkpZBOzlmlLOvn1eA2vo3QQ0JALjsU9aewivpGx240P2QAJgJa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4+Oa/9qIdljttOSGJiUBZiM0cd7rPBS9QeLnKlRF6wdPyG9+06n3/H3BAjef2gG4n88Xh6/zk2trD2ycTEMG2D6KY/LNlFweGvfjkRQErdxFFvpWKjBWHEz7Oe3BgzqThjFahqKrQiW2V7UgHVSzmyOohLkn0reXwCgYvdOQtkV37JFL9TmHOsaymLdD4twUdlqw+n3InjCI0naGJYe4uoZVJHHrCA+52ZFb9VD2Cv4iBUYidYvFF57u3Vv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(125551606395959)(133145235818549)(236129657087228)(767451399110)(148574349560750)(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)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1152; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1152; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUyOzQ6SG9aNmdOZXZnSHBNaXRGdTVSUGZUU24zV0p0?= =?utf-8?B?dk1hemF4WTR5Z3NYNFFFUGhjM2k3MVhLdVorMDhXeTZ0NTZTNWlwcEhaR0Jv?= =?utf-8?B?RkVobWQ4d1MrS3RJYjhXdHN2dytZejQ4WFJURFNKa1lGdXp5N1hiZkM0enUv?= =?utf-8?B?MW00Yy8rYmIrc0oySFZXRGVSQmNCSis0MnVJS0hBK01SNjhuS1owNzJrS0tj?= =?utf-8?B?S0hzN2Q2U0M4STJudlYrMGVWQWNMbXFGekIvWEZQNXAy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3VEpWUUY1T2VBeDFucHhnWDNWeUhYdnZQbW1nd0ZEQTBh?= =?utf-8?B?ZldjM1ZFS0NnODNwdmdRN0pScDhIYlBUcVBVZFNIblRwWVRYY0xXU1VwcEY5?= =?utf-8?B?VjRjbmVuVkhUYzVTNjlENTVWdVVqakR2eEYwaXZJNWNvU2lyN3hwTEpGbTRv?= =?utf-8?B?VFBDRzF0U3ZZVTNHTldaWnVYRC9JUHJiVmwrUW1FOUwwNHVKc0crNzByVm5G?= =?utf-8?B?NWF3RUtsOVpOSkVFOWxjZmdndm5SeDllZlZLT0hBWjFZNDJCZjZYU1R5SURL?= =?utf-8?B?bmxhd0IvS1FVTlF0OUtRZGtYUnRBdWh4VzRpY0x2UjJ3eDVLNEJzUytqNFpq?= =?utf-8?B?akNvdi9QYndERGpya1FuekFpUjhXZHNUNjhwRjhEeFlacndSVG5ZNW9hM3pu?= =?utf-8?B?bDhFOUVsZEFCcHVraDhQUE50K2pSalk2U2YrS1gyeXE5N05vMkdCcGRqNzNq?= =?utf-8?B?alNXUHlVUXl2NUpWN1RCRlppWVVlcXNoL1JnR2VXSHJHMDgrYWttS2pWdFRx?= =?utf-8?B?VUNXR0svVDZ0RS9iMHRyaFI2UkR2ellRREZrUi83RjZlT2hoaTNlWDhZWk5u?= =?utf-8?B?SGNRdm5pVWlMK1lncHl0UTBaS25wd3FOVWhaOUdRRU9OUnVUTG44YkQzT2o3?= =?utf-8?B?cjcwYUw5TU9rWGZPM0dWcys5OEdkeW9xMFlyeXBEOERLbGxwTE9wcFQ5MTNi?= =?utf-8?Q?EYcxbus8mk=3D?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(23676002)(47776003)(7416002)(76176999)(50986999)(4001350100001)(54356999)(5660300001)(42186005)(478600001)(189998001)(2950100002)(4326008)(103116003)(25786009)(7406005)(72206003)(66066001)(6666003)(53416004)(97746001)(575784001)(33646002)(86362001)(305945005)(8676002)(53936002)(9686003)(54906002)(2906002)(110136004)(50466002)(6506006)(6116002)(3846002)(1076002)(7736002)(55016002)(83506001)(38730400002)(230700001)(81166006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1152; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjEyTUIxMTUyOzIzOjA3dTBobWM2cjlIdXhSRjhjbXh2VENMaVZ3?= =?utf-8?B?bVBCc3c4bU9uZHNMaTBSeTl3bU1VcEQ4aHFUZUNOVzdFcG9YOVZua0duK3Z4?= =?utf-8?B?U2NJQjFYS3hPWFVZR0dyT1FLN1FDVFVKOGRmMmlWemd5T2Fmcms1TXdlQkky?= =?utf-8?B?N2REZVdNMjFsZkJNWW5ING1CRFBIeEYyL3Noamo4TXdnMkg4c0hhaStkM3Qv?= =?utf-8?B?aVh2UkQ2NVN1TkxERUFONkFCM1hmN3grdWNBOHhhWUlVMW1PV3Z6U09JOXhZ?= =?utf-8?B?S3I0R3ExN2dpeUdLeXpOZmIrenJickxwVUY3QWsyWm1pR3FheUJEZEJmUXpj?= =?utf-8?B?UTMvVDQxY0J5Q21kZ2xJZjQzc0lWMWY3Nmd4VmE1a3orVDY0NFNpcFdwRFkv?= =?utf-8?B?ZnVkWHZIOXpyaStEa2tSUFJROHRyNkIrWGp4dDNyenlpWmxBc0oxaDE3QWhK?= =?utf-8?B?MUlMZ29Bcy9SUXBMV3FKOHA5a2pLR1YvSENMVG9MTElZanV5bzhmUUErMU5h?= =?utf-8?B?eHhjZEtZTTdrNm5JVDFyQ0hoL05MU3NJLzF4K2h4SER0dmpweWFTbk56WTVx?= =?utf-8?B?MzBFMjhhMDhuRFk1R2pxU2h1RFdZbktyOHE3NjNwQ3YxalNZbXczSHI5K2Iz?= =?utf-8?B?Um12UzhzOHhNMDJOd0F4S0tUSDZTMUEr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fL+uxkD4Y+W6GUVqLO9X6Ge3bteSnfAzKhyAgtjaJrMdYVVWwhku1trxzk5Z8v8+LOwNiWt52XidVVoWTj1hsigRLW9hcj/WdjWEkbVpkz9IsLkzs2LhO8elIrp9vf4nrwuOnvOUQ2GFofkFFdxwXGo5G/P/FYAoliuCoSvfM0dMJBb7XNZKKKsXbS4Bx0TxlXRaDG4tyi62+PHBhdxXgE/7tNScA15v/TBG2gr4AMD7Q2xWeKsuyXT3aiaYxNk+9u1HMl88= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1152; 20:Bq0os7lRulpLqZ/1ksofrC006xwK2UuICQJvUAboOfooHzNiT99urqUh/mdWYjk0+PbUW4WWN1rK+YmSGFc08O1nwx66WfBL3l+5P1B1tRmGK/3NJ7lRjulAxm5KuJmtder7Eg6uxxO3/JnKgRFfVL3M/Q6tlH2gKJBYwCrTI5SeGdwXQUNXCeej/8k3+9mRnCyDM/RwXL75818blV8DPZImIKFZzb3lYMFohLK6+bZHSGffvQ3FBQtQPik1OPbc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:08:47.6199 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1152 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 08/38] x86/mm: Add support to enable SME in early boot processing 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 the early boot code to use Secure Memory Encryption (SME). Since the kernel has been loaded into memory in a decrypted state, encrypt the kernel in place and update the early pagetables with the memory encryption mask so that new pagetable entries will use memory encryption. The routines to set the encryption mask and perform the encryption are stub routines for now with functionality to be added in a later patch. Signed-off-by: Tom Lendacky --- arch/x86/include/asm/mem_encrypt.h | 8 +++++ arch/x86/kernel/head64.c | 53 +++++++++++++++++++++++++++++------- arch/x86/kernel/head_64.S | 20 ++++++++++++-- arch/x86/mm/mem_encrypt.c | 9 ++++++ include/linux/mem_encrypt.h | 5 +++ 5 files changed, 82 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index a105796..475e34f 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -15,14 +15,22 @@ #ifndef __ASSEMBLY__ +#include + #ifdef CONFIG_AMD_MEM_ENCRYPT extern unsigned long sme_me_mask; +void __init sme_encrypt_kernel(void); +void __init sme_enable(void); + #else /* !CONFIG_AMD_MEM_ENCRYPT */ #define sme_me_mask 0UL +static inline void __init sme_encrypt_kernel(void) { } +static inline void __init sme_enable(void) { } + #endif /* CONFIG_AMD_MEM_ENCRYPT */ #endif /* __ASSEMBLY__ */ diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 46c3c73..1f0ddcc 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -45,9 +46,10 @@ static void __head *fixup_pointer(void *ptr, unsigned long physaddr) return ptr - (void *)_text + (void *)physaddr; } -void __head __startup_64(unsigned long physaddr) +unsigned long __head __startup_64(unsigned long physaddr) { unsigned long load_delta, *p; + unsigned long pgtable_flags; pgdval_t *pgd; p4dval_t *p4d; pudval_t *pud; @@ -68,6 +70,12 @@ void __head __startup_64(unsigned long physaddr) if (load_delta & ~PMD_PAGE_MASK) for (;;); + /* Activate Secure Memory Encryption (SME) if supported and enabled */ + sme_enable(); + + /* Include the SME encryption mask in the fixup value */ + load_delta += sme_get_me_mask(); + /* Fixup the physical addresses in the page table */ pgd = fixup_pointer(&early_top_pgt, physaddr); @@ -94,28 +102,30 @@ void __head __startup_64(unsigned long physaddr) pud = fixup_pointer(early_dynamic_pgts[next_early_pgt++], physaddr); pmd = fixup_pointer(early_dynamic_pgts[next_early_pgt++], physaddr); + pgtable_flags = _KERNPG_TABLE + sme_get_me_mask(); if (IS_ENABLED(CONFIG_X86_5LEVEL)) { p4d = fixup_pointer(early_dynamic_pgts[next_early_pgt++], physaddr); i = (physaddr >> PGDIR_SHIFT) % PTRS_PER_PGD; - pgd[i + 0] = (pgdval_t)p4d + _KERNPG_TABLE; - pgd[i + 1] = (pgdval_t)p4d + _KERNPG_TABLE; + pgd[i + 0] = (pgdval_t)p4d + pgtable_flags; + pgd[i + 1] = (pgdval_t)p4d + pgtable_flags; i = (physaddr >> P4D_SHIFT) % PTRS_PER_P4D; - p4d[i + 0] = (pgdval_t)pud + _KERNPG_TABLE; - p4d[i + 1] = (pgdval_t)pud + _KERNPG_TABLE; + p4d[i + 0] = (pgdval_t)pud + pgtable_flags; + p4d[i + 1] = (pgdval_t)pud + pgtable_flags; } else { i = (physaddr >> PGDIR_SHIFT) % PTRS_PER_PGD; - pgd[i + 0] = (pgdval_t)pud + _KERNPG_TABLE; - pgd[i + 1] = (pgdval_t)pud + _KERNPG_TABLE; + pgd[i + 0] = (pgdval_t)pud + pgtable_flags; + pgd[i + 1] = (pgdval_t)pud + pgtable_flags; } i = (physaddr >> PUD_SHIFT) % PTRS_PER_PUD; - pud[i + 0] = (pudval_t)pmd + _KERNPG_TABLE; - pud[i + 1] = (pudval_t)pmd + _KERNPG_TABLE; + pud[i + 0] = (pudval_t)pmd + pgtable_flags; + pud[i + 1] = (pudval_t)pmd + pgtable_flags; pmd_entry = __PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL; + pmd_entry += sme_get_me_mask(); pmd_entry += physaddr; for (i = 0; i < DIV_ROUND_UP(_end - _text, PMD_SIZE); i++) { @@ -136,9 +146,30 @@ void __head __startup_64(unsigned long physaddr) pmd[i] += load_delta; } - /* Fixup phys_base */ + /* + * Fixup phys_base - remove the memory encryption mask to obtain + * the true physical address. + */ p = fixup_pointer(&phys_base, physaddr); - *p += load_delta; + *p += load_delta - sme_get_me_mask(); + + /* Encrypt the kernel (if SME is active) */ + sme_encrypt_kernel(); + + /* + * Return the SME encryption mask (if SME is active) to be used as a + * modifier for the initial pgdir entry programmed into CR3. + */ + return sme_get_me_mask(); +} + +unsigned long __startup_secondary_64(void) +{ + /* + * Return the SME encryption mask (if SME is active) to be used as a + * modifier for the initial pgdir entry programmed into CR3. + */ + return sme_get_me_mask(); } /* Wipe all early page tables except for the kernel symbol map */ diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 6225550..ec5d5e9 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -73,12 +73,19 @@ startup_64: /* Sanitize CPU configuration */ call verify_cpu + /* + * Perform pagetable fixups. Additionally, if SME is active, encrypt + * the kernel and retrieve the modifier (SME encryption mask if SME + * is active) to be added to the initial pgdir entry that will be + * programmed into CR3. + */ leaq _text(%rip), %rdi pushq %rsi call __startup_64 popq %rsi - movq $(early_top_pgt - __START_KERNEL_map), %rax + /* Form the CR3 value being sure to include the CR3 modifier */ + addq $(early_top_pgt - __START_KERNEL_map), %rax jmp 1f ENTRY(secondary_startup_64) /* @@ -98,7 +105,16 @@ ENTRY(secondary_startup_64) /* Sanitize CPU configuration */ call verify_cpu - movq $(init_top_pgt - __START_KERNEL_map), %rax + /* + * Retrieve the modifier (SME encryption mask if SME is active) to be + * added to the initial pgdir entry that will be programmed into CR3. + */ + pushq %rsi + call __startup_secondary_64 + popq %rsi + + /* Form the CR3 value being sure to include the CR3 modifier */ + addq $(init_top_pgt - __START_KERNEL_map), %rax 1: /* Enable PAE mode, PGE and LA57 */ diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index b99d469..3ac6f99 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c @@ -11,6 +11,7 @@ */ #include +#include /* * Since SME related variables are set early in the boot process they must @@ -19,3 +20,11 @@ */ unsigned long sme_me_mask __section(.data) = 0; EXPORT_SYMBOL_GPL(sme_me_mask); + +void __init sme_encrypt_kernel(void) +{ +} + +void __init sme_enable(void) +{ +} diff --git a/include/linux/mem_encrypt.h b/include/linux/mem_encrypt.h index 59769f7..570f4fc 100644 --- a/include/linux/mem_encrypt.h +++ b/include/linux/mem_encrypt.h @@ -30,6 +30,11 @@ static inline bool sme_active(void) return !!sme_me_mask; } +static inline unsigned long sme_get_me_mask(void) +{ + return sme_me_mask; +} + #endif /* __ASSEMBLY__ */ #endif /* __MEM_ENCRYPT_H__ */