From patchwork Fri Jul 7 13:43:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9830429 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 D5774602CA for ; Fri, 7 Jul 2017 13:46:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9C652833E for ; Fri, 7 Jul 2017 13:46:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD843285EB; Fri, 7 Jul 2017 13:46:16 +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 CB9492833E for ; Fri, 7 Jul 2017 13:46:15 +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 1dTTYI-00064G-S5; Fri, 07 Jul 2017 13:44:10 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTTYH-00062j-CS for xen-devel@lists.xen.org; Fri, 07 Jul 2017 13:44:09 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id FE/C3-03612-8209F595; Fri, 07 Jul 2017 13:44:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+Ng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21.messagelabs.com!1499435045!72231682!1 X-Originating-IP: [104.47.42.76] 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 44090 invoked from network); 7 Jul 2017 13:44:07 -0000 Received: from mail-by2nam03on0076.outbound.protection.outlook.com (HELO NAM03-BY2-obe.outbound.protection.outlook.com) (104.47.42.76) by server-7.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 7 Jul 2017 13:44:07 -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=RE85ij64lYMXOHxqQrl7Gonr/+1b33fWy1/t3QOPQtM=; b=b4xc/jkNXWE+0OEAUkc06xD5cuEYLj3bwDrnaEViTFfXqUghfaTIu04LFKNfggtJ5Ok2FyHa8edkR1g3Vnb17p+8I4o0YnL8yhwCpaEjJZjD+KBz95AWdw3x4KjlCVIyW6Fto56YIIbr9sBg/rIetbZ+92vCSuD1OgD8cCtRKKY= 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.1220.11; Fri, 7 Jul 2017 13:44:00 +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:43:57 -0500 Message-ID: <20170707134356.29711.66121.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: BN6PR03CA0062.namprd03.prod.outlook.com (10.173.137.24) To CY4PR12MB1144.namprd12.prod.outlook.com (10.168.164.136) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09b9c368-2118-4f14-1d13-08d4c53e3b0a 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:CY4PR12MB1144; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1144; 3:R32yO4aMXlvYpkNf08SuK8x3P9198RS417OeR5OiSCUxYapCTV3dZ3LJDjx1a2zy0+0C3tumMeHuTOcDU6/Z3Zxo9AQYQvJgfxSxwXMOVReoNflkPROPvlY4vvOCy1jGmZNwwSqIAj7k5yCPmzjCH5KZIIouX3zoleEMHBNhH3muuYew93nnD3k8Gi9iK5MW6na596+EZARv6bc0eX5lFF6/imLn1OuF+p6mqANl1fkYgva8q2XXKpNjIwnkXqCg87qVkspf3pl0FedhfWZtF3KR6uwxeF02+Suai+W/X505PA9zz0pRl4yNPeJ2auM4bnP6Dviafo2yToaji/06wC8LT4CIApBAwrpCMjQUH7BiHzHyu+o6t2a84gCn1r6fUDcqXVMeI8Hh0dC5frktGwze9eCAxwOPk2LuN4gpGXweFeK/1lsanpnj/orhjXPHFP8Ag+nzZjBpa6L05sbSv6pkD57IL4+hAD8JbJeC/vgHXiTJeWeoqnNe/jEr3YgSX03Rs0ouqTFFGamhwGNmDCNaCRklyJJxwQytd/fRB/wkrQZD8rdijXhtWfOiELf1/byqZSUST1YovSRenWX2Wn7i56rH0zMuTlmKE9kOFzneLpnqMM6vckaM4oWwCkcSCrJc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+sVQFeyESPIbPYRxkcasyOXB4eCsuzaGqV03mc5uKOnEMSlX9YIikCKYvvRTB/x24uktrkoGKlAov14FBPX5LbBZgBpjPpZmZgOd/sRB9/wvNg+hzveAt1q519J31lkHUPIweWLWttL+pV0UWg0+0rN0316bg90t/Yd0zNh/vjVukoS8sXs1K3hh3tZAP/S8eFkikx/mtpbJPceLDm7YgX6YVHFZm2vqhTli4tXirmO2epXTEb7xD9dCiUPhfq11DuDmlfQ4JrzLYJ+ozjEId2il 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)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(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?MTtDWTRQUjEyTUIxMTQ0OzQ6Vmp2RHRVNjBzYmd1V2ZDNWVaQ1JhWXJJOFdL?= =?utf-8?B?TUM4Wm9LQ0VvbGlFK0ZhSk9rTEZCd2FqaGV2YmlNYS9LUmJ5RUU1ODR2RWxp?= =?utf-8?B?UEY1aGdrSXZLdWJxd2MyWXJDY2pJQWFYKzRLU3JKVzFodVJ5dlluMVBqWEJ1?= =?utf-8?B?VXlUZUR3ZFExNkNLenM4ak9ub3ZDYms2M0tFMUxIV2dxbzJDRDR3eFJiTkpG?= =?utf-8?B?Qjh5ekdUZy81dlV2U1NKa3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UVhLSmUra054YnhOTUxlbGw4QVdYNVlITXcreXJmWUQwbGJXNDl0d1Nt?= =?utf-8?B?dklTQmtBV2xwZFpRTTM4M0RGa09jSUx0cFNEQ2VveFJPOVprMFlPK29TSUFM?= =?utf-8?B?WXMrMFJYdytJbmtScDNrNzg3UHpyakdRRTUycUpkSHJ1eDN5MjBZdjNQbUJt?= =?utf-8?B?K1kyRDhpeUZMNnM1YW5QNWd6bml2TkVaTkdBdk8wOWN4WUEwUGp2SnN2ZG1s?= =?utf-8?B?M2Y2VWdMZ1BqZDNNVnhXSHhIa1NlSzNXSEk4TzVXOFpTbVBjYjBOb0Jla1lR?= =?utf-8?B?UFhnMjJYUlNRRXpSZXlhUXEvcUoyT0wxVWprNFoxcitHQlduT3RUU09OczQw?= =?utf-8?B?WHBmU0pVbjBBbEsyTExkQ2VPbGNGNmhRK3JadnpxZ2tHb2lpVU9sNEhDY243?= =?utf-8?B?MTFKNTRETFpFQkN2TnBhZWM1Y251WVlKeXJUYXRZbDhNSGd1R09KSXd4ZFM3?= =?utf-8?B?QWJUYmJ2Z1ZUM3VNS0tHbWZLQmZPU2UzZHdlQ2RRTmRTMEZKZzhzQ0NMTXF5?= =?utf-8?B?UDNUdTlBc3JhYnBNMWRBSGY2d1VyVVdpeTNHM2VjQ1BrU2RlUVNpVVBhRDdC?= =?utf-8?Q?hk3Hbqg5N5hCrDvg9GZBmrIKftWiIm8aF5/s=3D?= X-Forefront-PRVS: 0361212EA8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39400400002)(39410400002)(39850400002)(39860400002)(39840400002)(25786009)(6116002)(7416002)(6666003)(53936002)(23676002)(9686003)(83506001)(5660300001)(8676002)(7736002)(54906002)(103116003)(55016002)(575784001)(305945005)(86362001)(3846002)(2906002)(1076002)(33646002)(38730400002)(110136004)(81166006)(478600001)(189998001)(72206003)(7406005)(6506006)(66066001)(4326008)(50466002)(97746001)(54356999)(42186005)(230700001)(53416004)(50986999)(47776003)(2950100002)(76176999)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1144; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjEyTUIxMTQ0OzIzOmZVbXNyTEJ5U3dvZ3JGMUI2TUE2THIrV2hO?= =?utf-8?B?VFBZT2hIejNxTDh3anNuZkNiL0FsSHdTa0M2TTZ0MWttYVROUjVYRyttQmVV?= =?utf-8?B?YWhwYXFsVHNGWmJZdzgxSXkvWC95SEdqUXd6Y2Z3aFpRZm5lN0MyMVMvZVBq?= =?utf-8?B?SWgyUHhZUlZic0FRTWpGWS9scmRxbEZxZkZUZVQ5bWk0WGRiY0FIUjN1akxh?= =?utf-8?B?SEswVko0c2lDWUJDeWFNQnJVWGlVNW1pYU5JTnh3RzdSN3lScTJ1SWI0eVJH?= =?utf-8?B?VVY4ZWVHMHVlR3dEWG1rZGRmRDJ2L1IyWUhNaFBleFhxUGcvdzI2RkV0bGEy?= =?utf-8?B?U0R2anhESEtNY3M5MUpwVk1kVW05bTBQTWRPZ3lHai81eUsycGsvcXROdUVM?= =?utf-8?B?dmJFR3Rha2orMDB6UkxDUVJLeVFEcnRBTFlMWEhKdlc4aVJUWTFGbU55T2lS?= =?utf-8?B?bTBUY2l6R2JXVkVhS3VPaWVMdXE3ZmxIQ0NRajdpc204VW4yNkVmMXJwVmVT?= =?utf-8?B?Zm5rSit5V25IRldTaUNLZDNBQ0J6TnYrYjcwTm5tbDl1MVh5V1hoWjFGYU9V?= =?utf-8?B?OGJFYXFaQkhEeEhjc0VSaVkySGQ4Mlc3c09YcTQ3TFFTcHNqWmJvaDIzSUhr?= =?utf-8?B?SDNOcU9VdU8rZmhhQ1JwNHBjb2VsZUxHWW1nMm9JbEUzUkw3MmtJOVNUK1Fr?= =?utf-8?B?UWFHQXZLakhOUlhvZWtvWmNhN2xFdnh0bm5xL2x6djk5dVZ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fQD+rjlVP1FReuoaVTgaXtsSwTLZZ8/ewuqn8hLt4iVjOkd6eenNCY58r3WAF4hx7Amjc/7sIONc4twlxCwvO2JHM4FSbYLXxD3MsM3oPm6U= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1144; 20:AxDj5gxw+CdZdr3ck8lzXl6NFruFCqFbiJHdBDz9M1pfJN24jjy7N3J4sGa6UAVMqOgC3fAjoRG9Q2Gt/maOYfn9uTrN0V6N8Lqoj/VJ31tGi/8dRmY2CZqWYuXP5MOL48IkJxuIzG2vlW4ydtg3Srt7fo1f5hlVq8VbtxH+7kDE6II58wIid5mFKxrqR8lKdRDe7pLesmG3lFjge4PnCRTQJ924bRZqXiYfqd3zxi9tQiptvnBSVgnXACOdjszR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2017 13:44:00.1807 (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 v9 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 3ca1980..bd6b85f 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 154ffb4..857a715 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -301,7 +301,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; @@ -310,6 +310,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; @@ -321,6 +328,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);