From patchwork Tue Jun 27 15:13:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9812495 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 6DF14603F2 for ; Tue, 27 Jun 2017 15:15:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FDE5286BC for ; Tue, 27 Jun 2017 15:15:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54422286CF; Tue, 27 Jun 2017 15:15:44 +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 88864286CA for ; Tue, 27 Jun 2017 15:15:43 +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 1dPsBF-0002rf-DI; Tue, 27 Jun 2017 15:13:29 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPsBD-0002pc-U4 for xen-devel@lists.xen.org; Tue, 27 Jun 2017 15:13:28 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 6B/DC-03032-71672595; Tue, 27 Jun 2017 15:13:27 +0000 X-Brightmail-Tracker: H4sIAAA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21.messagelabs.com!1498576405!75783401!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 17083 invoked from network); 27 Jun 2017 15:13:25 -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-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 27 Jun 2017 15:13:25 -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=f4Px/lDSq5iYSlVy1rrfey6vexHkevNMoCYnfQSzJRo=; b=toJHxNQ+Lmmqg1Aopi5ENrp7LFbQOcWieLswb0PTqBtgIQJDKQ1l6wnXaaenROmwdDdc7k03ZmKnxpkNIs6A8Vu8KUmQWcPnaJehquXkzTrZt0lQ5MCDZWDkeejwmyzUgzBseH3FntW9y5rtDXwXrr3t2j4L18hfRX7NUEWeJOI= Received: from tlendack-t1.amdoffice.net (165.204.77.1) by DM5PR12MB1147.namprd12.prod.outlook.com (10.168.236.142) 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:13:18 +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:13:14 -0500 Message-ID: <20170627151314.17428.39391.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: MWHPR03CA0058.namprd03.prod.outlook.com (10.174.173.175) To DM5PR12MB1147.namprd12.prod.outlook.com (10.168.236.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be0aa8fb-ff5c-4e5c-5397-08d4bd6f0cea 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)(300000506067)(300135500095); SRVR:DM5PR12MB1147; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 3:CXZ3h1/+0bE40YXuMA4ZxJxjoARB4pzXpY6s0L/AvEJbF54EgoYCQZW/z5HIYaNwLN+bikPvMT0NslkCRW/+P3PieopLYIkCQC5ZAE07ki7mW+XQWa6ePQvoNed99sApQNxwlXuEZD4smNLkRebdTcPEXVCV/V04I1M0DFlE6lwLlORtze8KJJX82IOQcP2DrUIkBth58uyBxPZFQCukccOuGl+qhuyOT8PoBYWgpuERWrMJUtr/4Ibi6looblztQ4YTCkFBVLYrrovdZ6PL1BkUfOmWHDTdL17D/QalDwpxiGW6TG3RCvYqMBnYtWKFI/ghaee9V+XA0fNE22e37Zp8Df4b1oAeT3hZJA9bxTGctZdGUG612A6/my/AZxDwk4yAf9dmeEJsPhX0ZWK0eePTAPPlj/49vqeFmbkPakD8a1NwXErOj7gf+TwCcmYikN/BcBgsV6L/bcYVBDV7yn8/HFtS/o+Q9q5iQRsJbsaEN3oCnY3EtIR1XFr8OWNATtk32XB/GMKpgFgz7wRg9sqUadKOJovs0lX7jT/JPgHJn09WunEWHpTZ3fSJmyID8wLbvTd4v3U6LXnZb9MpkhuetBlFj9/Khi0ia3QQI2UgxlF9cV/1m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06KVojlymCxNmJSMFlAN1pyN1N2smiprkfiP8lxtpwlD9GnZ/o158B1Jzxi7K6Zja+MY5OTQhkNGD6fxjwn2END4LrRd0jT4/ze5GhbuPnM7XVzNVIShQ+rN87LrAEjXQ3ifc1mW3yZXsXRZLyCOu1U7oqqi2jEeaqew3GwJZSUCh4hEtuzgD4EHYMdZD22+9pTTaYy4y8ZhI5NvYVOe3Z5jbBfpO2Sv3KpBV7nHJBuMcnr/msZ4HCPccrInPOwWQhY2GiIu7aHe7c0Izz9szm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(133145235818549)(236129657087228)(767451399110)(148574349560750); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR12MB1147; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR12MB1147; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ3OzQ6ZStPZWN5T1I0aFNOQ3lnV25OZ1kxV1kxTEEw?= =?utf-8?B?OThJRjBxQVpWdCtKc2ZveUM0SmdSTnVSU2ZnZkk0a2ViTzd1bE9CaWU4UjV1?= =?utf-8?B?SVZORE00OEFhbG5ZRS9SOXozRzhtWDN5YVZqbUxnV0ZMMU05bXVzaEt6WUZF?= =?utf-8?B?bmVocUlyUmY2VnU2NHhabElaeEJyeThRbEcrZUVnaklreWdjK1V3dTF5NHpJ?= =?utf-8?B?MTJIYkdUd3pJb2FkL1V6Zz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XY5UHpzN3pXQXpUdlFZK2JyNWRpdExDWlJlWUJEa2F6U05P?= =?utf-8?B?VTN5ZFRvSUVNTVBFS3lTTmJMdEJIQ0E4ajhIRzhmMXBmUm5yTjFOSXZaTmU4?= =?utf-8?B?cnc3LzVMZTM2aUxHMWdqTzFLN01iTXNCcmlYa2Yvamp0RUhPanYvSm11Y25v?= =?utf-8?B?dU1zc1Q4dTUzN1NNY3lYc1RyM0dFUk1VY2ErZTRtejJVaVJOOEl2MGpBMUp0?= =?utf-8?B?bEovR2I5R0RreWpDZXcyRG9uQkVTMjExVWw1ZXNsSVlyNk5yWUIxc2VPeGpy?= =?utf-8?B?TDgyVmRhazBrZGVPbW1rV1BqcnJFYlFxTXVNZ2RYS01RK2xQSENBM0lzTFIy?= =?utf-8?B?NWcvc0JpNTJsUGJjTDhhMjVxWG0rcEZPOW1ndk5JT0RjbWdBV0YzVWZWY3N2?= =?utf-8?B?NXRnRGJsVmtSN3RlMytkUlRVbWtmRmVOVmE0WTVoRDVxdG94djBEZUlIdXY4?= =?utf-8?B?V0pobGR2T0JNdkJPQWQyb2MvTExNSVhrTHVDeWNqT21tT1gxV0VhcEh4Zi8y?= =?utf-8?B?R09iMkQxSjAyRm1kOWc1RVZCN2FZekxMZzl6Q2l0dVltVzBxRkpDaThJaVYv?= =?utf-8?Q?mMuanxbyYmXGYtimIFU0gqJTsekZASOrogIY=3D?= X-Forefront-PRVS: 0351D213B3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39860400002)(39840400002)(39410400002)(39400400002)(39450400003)(39850400002)(81166006)(1076002)(25786009)(110136004)(9686003)(2906002)(66066001)(97746001)(38730400002)(4001350100001)(54906002)(478600001)(33646002)(72206003)(189998001)(103116003)(4326008)(55016002)(54356999)(86362001)(2950100002)(5660300001)(23676002)(6116002)(230700001)(3846002)(50986999)(6506006)(76176999)(305945005)(7416002)(50466002)(83506001)(47776003)(7406005)(8676002)(53416004)(53936002)(7736002)(575784001)(42186005)(6666003)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1147; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjEyTUIxMTQ3OzIzOmNzRElaY0hmSUhZeWQzdmQrUkJxblFDQW9q?= =?utf-8?B?WHlrRUF1UEpYTmQyZmVIWjJmVWFpMnVmYTg3RmhFTUhCRnpDdzNEbDIySGpK?= =?utf-8?B?cUZxUDZxcmZDa1ppSXZjMmxadVMzZmpNUHdxZWQ2Ni9WbHVwR1hQb2FHMDA0?= =?utf-8?B?V25SaGZBNnJMYmN1NWhTZWs3blNzR3FkbW1mZG11L1A3cDRaVDJjazEwTm0y?= =?utf-8?B?eXEvUkNLc3NuQjI2UnVrNHNaRW1vbUZwT3NscXdPTi9nenN1SDkvUFNkQzFI?= =?utf-8?B?SkJSQVFpM2pjUVZ4OUpHU3h3b0NlMlNCbzB3SE83NmR1NDBPWGJTd3E0cWsz?= =?utf-8?B?aEZ6RkJIQzdaUDJ5Z2c5NW9nUzNtZFhPd3A4K1VjWk8xdnJlVDNsVzBQb2xp?= =?utf-8?B?REROYWgySHZBVkYwazd0STlRWFg4NktEZHVMalA5NGF0TmNLREgyYXN2SUVj?= =?utf-8?B?NlNSeWg5blFqeElDeVgrdU9OMVhEK0thekpRV1BaNlozYmJ5Z0wvQ1VPTmwz?= =?utf-8?B?SVdBWkRHSElwTkxiUkU4c3pPVE1CT2UvY21tUHIrdVkxVE9KZDMyanZETVlz?= =?utf-8?B?WVpsbmtuSUhMNzl6ZnJ5czBlaENaL2FSTnRhY1k5amYzWVJyV2xrLzRSSUNJ?= =?utf-8?B?aHBpZ1RwUWlNbTBPY0Y4S0MrZjM4MnFkc285TFkvRmZodFRPM0pjRmUxM2ts?= =?utf-8?B?Z3hBK0pNNHN1eGg2bzNZeUZHMFY5SlNMbU9xOVNOM2xSdXNCamlsZ1ZzLzUw?=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sC568r5e+3utKrlpQ7TFF0OgeMxqk40NkH+jcquiLPHvZlRzpF2LLcuTx3geS8mkuR7RdjmCOSRnySgJoKoZzPbXJIOh67vfxv9JNNs6jl8f8uXbVjCMD6BWTCDXv8lbIvzFAGrdqz9iwcGtjGIpL4oQLc2d41Tu9jWTklSj2f2dsCJu8bw7xQtr2UGa2AJGFMjEjPd3DOlDL3lJQy6uCd08wM3PC+q/kO01wjnnjpQhE58T; 24:sh3G2Sr9WbTmX5UhhxClV9muCurRr8NdtCxZheTeeGAqo/52eJkPf115Hs6sxQL4jV9FDg3d4tCBI8oNARhR9lL8Ghsm92LMLW7/pT84sqg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 7:l7nQvz5kRQzYd7L6wy5qUvCafoDOcxYVFhD+wAQpNND8jZg1MTvl0w6Og7rz9xkSPCxDnKqbiqv73YCgw8BfyeoEMOwxuv24a4b16yDLEhiKFgxm6oXnCaiJKHaxZhHq6OaXvEi+b5Et8uNfnv9w9zkbkmdn5amlnRGp0gymXQuTw6RbhiECV86UaK/CwPnfQ55/O/xNiRdfffeXBHtuw8Vt+uo0ZcOeBWP9hI3IPWZ611BwVhXbHHcPq37STRxzwLRXpGjZK4ceh9I6906tylR1OKnKwkgQUOej2bSf9xd1eBE/yNiEpF9XhlORwtiAkCIHcoaqHwFopA6kq9y9V5Q9VA7RwQINcSX23pahLlOOPIjgDJmijPObmgJVojEA29FxmtYDa29G8GYCLeoL80fSOAu5PxNAgygHegy/S/re2akAfwWx0GK7hRMd5VODizWVnASDrqojjatY0UIUMk9M9DSiQneHvIMhsH7/QtmKbpIPU7BgR5UahGmhy8cz0Npho3sd8mCjr3y+Ote4pYugvkNZBOjWD86z9AMbhucfChXxsRDy7jygXnKiEcHrTN12KEQEPy9GH1WWIzN5bfUNvcSA3czwJfmUgMVqrBFyoxCCzG1BhOTOuDBx/6TYWObPWTp2W93Y53cvGHnomcLGGBiQJ8jNGTllkp5XTLllru1k3QmPjwXc1Fft9MoWSyQuCKoyDuAs/OO5u6VN11LHTRWO1QD8vp7HSvCxf3HSWgHFUr8Xo01USgP6U2A8JWvkNvlocOFJSHFdmGj1w9SRttyNwA3guKvt8MeHei8= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 20:5bAvfAbKVIp73kkA1briOw/8AJzCkiorD+W06fBOhQC9HrxK7ZJtOsh9HV7FlG6V9pzGQrJl+HSNHL3dTeZ1LcZpdfPZpxsOrKrKct79tetEm9YRlHr/RcmR1Ym0ze+QJByF+rlJ23+zANVBwDM+q0BTkDw9k3ULFxYAbchZJZPuCJA4g1JOuoAxt0Cebtnu/pwed+Fi9bMy471ZTR/vYeVoCuBTQzQduho3YI1eJ1a4FBMl0bDXlJ4ToCsU7Jqd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2017 15:13:18.8877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1147 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 31/38] x86/mm, kexec: Allow kexec to be used with SME 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 Provide support so that kexec can be used to boot a kernel when SME is enabled. Support is needed to allocate pages for kexec without encryption. This is needed in order to be able to reboot in the kernel in the same manner as originally booted. Additionally, when shutting down all of the CPUs we need to be sure to flush the caches and then halt. This is needed when booting from a state where SME was not active into a state where SME is active (or vice-versa). Without these steps, it is possible for cache lines to exist for the same physical location but tagged both with and without the encryption bit. This can cause random memory corruption when caches are flushed depending on which cacheline is written last. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/include/asm/init.h | 1 + arch/x86/include/asm/kexec.h | 8 ++++++++ arch/x86/include/asm/pgtable_types.h | 1 + arch/x86/kernel/machine_kexec_64.c | 22 +++++++++++++++++++++- arch/x86/kernel/process.c | 17 +++++++++++++++-- arch/x86/mm/ident_map.c | 12 ++++++++---- include/linux/kexec.h | 8 ++++++++ kernel/kexec_core.c | 12 +++++++++++- 8 files changed, 73 insertions(+), 8 deletions(-) diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h index 474eb8c..05c4aa0 100644 --- a/arch/x86/include/asm/init.h +++ b/arch/x86/include/asm/init.h @@ -7,6 +7,7 @@ struct x86_mapping_info { unsigned long page_flag; /* page flag for PMD or PUD entry */ unsigned long offset; /* ident mapping offset */ bool direct_gbpages; /* PUD level 1GB page support */ + unsigned long kernpg_flag; /* kernel pagetable flag override */ }; int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page, diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 70ef205..e8183ac 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h @@ -207,6 +207,14 @@ struct kexec_entry64_regs { uint64_t r15; uint64_t rip; }; + +extern int arch_kexec_post_alloc_pages(void *vaddr, unsigned int pages, + gfp_t gfp); +#define arch_kexec_post_alloc_pages arch_kexec_post_alloc_pages + +extern void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages); +#define arch_kexec_pre_free_pages arch_kexec_pre_free_pages + #endif typedef void crash_vmclear_fn(void); diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index 32095af..830992f 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -213,6 +213,7 @@ enum page_cache_mode { #define PAGE_KERNEL __pgprot(__PAGE_KERNEL | _PAGE_ENC) #define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO | _PAGE_ENC) #define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC | _PAGE_ENC) +#define PAGE_KERNEL_EXEC_NOENC __pgprot(__PAGE_KERNEL_EXEC) #define PAGE_KERNEL_RX __pgprot(__PAGE_KERNEL_RX | _PAGE_ENC) #define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE | _PAGE_ENC) #define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE | _PAGE_ENC) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index cb0a304..9cf8daa 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -87,7 +87,7 @@ static int init_transition_pgtable(struct kimage *image, pgd_t *pgd) set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE)); } pte = pte_offset_kernel(pmd, vaddr); - set_pte(pte, pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL_EXEC)); + set_pte(pte, pfn_pte(paddr >> PAGE_SHIFT, PAGE_KERNEL_EXEC_NOENC)); return 0; err: free_transition_pgtable(image); @@ -115,6 +115,7 @@ static int init_pgtable(struct kimage *image, unsigned long start_pgtable) .alloc_pgt_page = alloc_pgt_page, .context = image, .page_flag = __PAGE_KERNEL_LARGE_EXEC, + .kernpg_flag = _KERNPG_TABLE_NOENC, }; unsigned long mstart, mend; pgd_t *level4p; @@ -602,3 +603,22 @@ void arch_kexec_unprotect_crashkres(void) { kexec_mark_crashkres(false); } + +int arch_kexec_post_alloc_pages(void *vaddr, unsigned int pages, gfp_t gfp) +{ + /* + * If SME is active we need to be sure that kexec pages are + * not encrypted because when we boot to the new kernel the + * pages won't be accessed encrypted (initially). + */ + return set_memory_decrypted((unsigned long)vaddr, pages); +} + +void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages) +{ + /* + * If SME is active we need to reset the pages back to being + * an encrypted mapping before freeing them. + */ + set_memory_encrypted((unsigned long)vaddr, pages); +} diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 0bb8842..fdad0fb 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -355,6 +355,7 @@ bool xen_set_default_idle(void) return ret; } #endif + void stop_this_cpu(void *dummy) { local_irq_disable(); @@ -365,8 +366,20 @@ void stop_this_cpu(void *dummy) disable_local_APIC(); mcheck_cpu_clear(this_cpu_ptr(&cpu_info)); - for (;;) - halt(); + for (;;) { + /* + * Use wbinvd followed by hlt to stop the processor. This + * provides support for kexec on a processor that supports + * SME. With kexec, going from SME inactive to SME active + * requires clearing cache entries so that addresses without + * the encryption bit set don't corrupt the same physical + * address that has the encryption bit set when caches are + * flushed. To achieve this a wbinvd is performed followed by + * a hlt. Even if the processor is not in the kexec/SME + * scenario this only adds a wbinvd to a halting processor. + */ + asm volatile("wbinvd; hlt" : : : "memory"); + } } /* diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c index adab159..31cea98 100644 --- a/arch/x86/mm/ident_map.c +++ b/arch/x86/mm/ident_map.c @@ -51,7 +51,7 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page, if (!pmd) return -ENOMEM; ident_pmd_init(info, pmd, addr, next); - set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE)); + set_pud(pud, __pud(__pa(pmd) | info->kernpg_flag)); } return 0; @@ -79,7 +79,7 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page, if (!pud) return -ENOMEM; ident_pud_init(info, pud, addr, next); - set_p4d(p4d, __p4d(__pa(pud) | _KERNPG_TABLE)); + set_p4d(p4d, __p4d(__pa(pud) | info->kernpg_flag)); } return 0; @@ -93,6 +93,10 @@ int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page, unsigned long next; int result; + /* Set the default pagetable flags if not supplied */ + if (!info->kernpg_flag) + info->kernpg_flag = _KERNPG_TABLE; + for (; addr < end; addr = next) { pgd_t *pgd = pgd_page + pgd_index(addr); p4d_t *p4d; @@ -116,14 +120,14 @@ int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page, if (result) return result; if (IS_ENABLED(CONFIG_X86_5LEVEL)) { - set_pgd(pgd, __pgd(__pa(p4d) | _KERNPG_TABLE)); + set_pgd(pgd, __pgd(__pa(p4d) | info->kernpg_flag)); } else { /* * With p4d folded, pgd is equal to p4d. * The pgd entry has to point to the pud page table in this case. */ pud_t *pud = pud_offset(p4d, 0); - set_pgd(pgd, __pgd(__pa(pud) | _KERNPG_TABLE)); + set_pgd(pgd, __pgd(__pa(pud) | info->kernpg_flag)); } } diff --git a/include/linux/kexec.h b/include/linux/kexec.h index c9481eb..bd7af8b 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -334,6 +334,14 @@ static inline void *boot_phys_to_virt(unsigned long entry) return phys_to_virt(boot_phys_to_phys(entry)); } +#ifndef arch_kexec_post_alloc_pages +static inline int arch_kexec_post_alloc_pages(void *vaddr, unsigned int pages, gfp_t gfp) { return 0; } +#endif + +#ifndef arch_kexec_pre_free_pages +static inline void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages) { } +#endif + #else /* !CONFIG_KEXEC_CORE */ struct pt_regs; struct task_struct; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index ae1a3ba..2df1c39 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -300,7 +300,7 @@ static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order) { struct page *pages; - pages = alloc_pages(gfp_mask, order); + pages = alloc_pages(gfp_mask & ~__GFP_ZERO, order); if (pages) { unsigned int count, i; @@ -309,6 +309,13 @@ static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order) count = 1 << order; for (i = 0; i < count; i++) SetPageReserved(pages + i); + + arch_kexec_post_alloc_pages(page_address(pages), count, + gfp_mask); + + if (gfp_mask & __GFP_ZERO) + for (i = 0; i < count; i++) + clear_highpage(pages + i); } return pages; @@ -320,6 +327,9 @@ static void kimage_free_pages(struct page *page) order = page_private(page); count = 1 << order; + + arch_kexec_pre_free_pages(page_address(page), count); + for (i = 0; i < count; i++) ClearPageReserved(page + i); __free_pages(page, order);