From patchwork Fri Jun 16 18:55:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9793337 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 EF7F560325 for ; Fri, 16 Jun 2017 18:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF39C2865B for ; Fri, 16 Jun 2017 18:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D111F28670; Fri, 16 Jun 2017 18:58:07 +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 071802865B for ; Fri, 16 Jun 2017 18:58:07 +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 1dLwPU-0004k0-Kn; Fri, 16 Jun 2017 18:55:56 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLwPS-0004gN-ND for xen-devel@lists.xen.org; Fri, 16 Jun 2017 18:55:54 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id E1/F4-03058-9B924495; Fri, 16 Jun 2017 18:55:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA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ref: server-14.tower-21.messagelabs.com!1497639351!67629187!1 X-Originating-IP: [104.47.33.54] 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 18352 invoked from network); 16 Jun 2017 18:55:51 -0000 Received: from mail-bn3nam01on0054.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) (104.47.33.54) by server-14.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 16 Jun 2017 18:55:51 -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=Nz9lzog0W9ESZbzeLNMFnAEOwq8p2V27osWkOiswRQo=; b=e73NhtxcAKjNsfqAz3e+HGBeHfiL1FkBqxKkI6v3Ms7O/nmS5h8v0/2uC/7xH53Fe3Q+pXGVhHnRecca+Lhifas91fW5Acf651S9hGr0LURHtsWJsD0A92aIg3NKOUTtUwM36GpP1Zs6k/rpzEmV/k2p3PyPkcXx9y6Jig3RUk8= 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.1157.12; Fri, 16 Jun 2017 18:55: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: Fri, 16 Jun 2017 13:55:45 -0500 Message-ID: <20170616185545.18967.90815.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: SN1PR19CA0037.namprd19.prod.outlook.com (10.163.220.47) To DM5PR12MB1147.namprd12.prod.outlook.com (10.168.236.142) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR12MB1147: X-MS-Office365-Filtering-Correlation-Id: cc9f42ae-84fd-4acd-4623-08d4b4e94e0c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:DM5PR12MB1147; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 3:zclIfTRwCRAIsR0RkyrXtlrkRj9TZGIC8tgXorac1aWNFPsBcocroOIweuCT7ZJiv6m2AHN7uRdzgWsS6h3KoUHmrCzECZvYQvikjOXD5tXMg0EUrvfe5moICrKmEbCmeK4dzqCMvpys0yGyyv4WWPBZP1G4r/coTNwtwJZALjd/vxOuJxrUW+btP9EYkzF6u+GaeKu3svcaju+Uffza5Ywiei2GW341hdWTVQAw1TH+JoffOgz//6X8SjVfToaHlx7QZFFNWGpflpkE2tK8MsrlbaiLryZLOqasolDY0Gyfskd/kaCNSh3YIbAKwkO/r0s7e2BL4YyGDg7kX6R1i1GgeR3knoczGFzQe2lNENE= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 25:P/3X9YDsZrAD6FzZPX4WnN/dUK4L04Z71lj9qzICVAqKbQGs/7VCLhg2iaT7yIGgxkKTlxHtj591iO6IRGVZFZJf68uwhIYHIPDDhJ2PyY4JobK/yM8PbyOa1jQz3KxELs/8BfGRne5o2b669vMFirSxJhx4N/Ivvau0sHCWO7HqmgAPEy8K7GBB63gFEpoJyyzvpc+LEeWeg6BEffyRKbEdbNTukqwhxHTeRJGuf5TUnEm+D13ai3d4dyz94F5egxWfwISVE3OWL4DRuj1yfOAD7W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apO69J1zb+YKfivbeHi980KaQH4StAdgyG9Rxl/a6nfs6NyoMFdLwRwuDq02viKLctTlI+7RTulBc2i61sVnbycF2Gy+s5zChpmFZ1d0S9w9tQ7++dLxgmIjGT6iyCei+ikmFJhEAwZlPNI4UgmTVbbadddyB+TV0pGepRC1hkkdDTZNOpmZNkgG7miq8d9jeglymfVz99bm0VLVFnatIGKb7nlKilG5E/kbx8qseYI= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 20:C/TyHJSUa5lZJ9iVFNnYru9Gqm7E0Paj2BKkP2XaoZBw2FoQN09mqIbmKEOnoxhhRNjPX9+1dQdFYKHhHVHlstazBfKkkx+bJf31VfexILX3L+oqgjXOmoUD9Y+4L9dhkOktc0awFmyHycjwnHSsJ/8ZB/S8Fj13BZlzDCCaP8H2FJMxhWPu6TVwwLVI9MTWrDGA4lzAqkIM7u5O1xpPFQUNaocEzt4W7r/hdDjV1Cwa4gkVJBFOEadz6BUOQ7HYQ6S1/17CaQJp+CnYU85ggf1Fir36u1zdthgqDEXjF4oOuS/wiaXanlesaTQK2yHwyng/LqEanxNNscpcROwgvlTQaTPjfcyeaiqlJGdy5L1N8EjnzFs0HUBXWrbQtMVHGsjvlC8J3ogVkjVS2YgbbxVynxVWuTqOLFYrWaFK8RWuhNfIy8ZdjKlQp+rnP5DU+Z7V41MshXY4b69JdXMWu/iemM+O1RBgBh//KclcOh/xoGeMjj9Xn/9HPOz408ck 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)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(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?MTtETTVQUjEyTUIxMTQ3OzQ6TzVPWlZWcnVodzhWeTJtNi8vRWVweWRNTW1V?= =?utf-8?B?Y2hJVW1tbnpvbFRWdlRubDE2anpMcGk1dXhvMVhYVlh3UGVQM3VFYUNSeGxD?= =?utf-8?B?a2UvbDFZZjJ4bXlGRDNVSllZSGV6bysrTW5pb0NUQVNqM3RDVGZWSDlHNzF3?= =?utf-8?B?Qm1CdGZEalBxamE3YTJ6ZzZ3Z3FpRUYyVDZyZ2U1K0FyUzhoMkpCV2RpTzFH?= =?utf-8?B?cEZqa0k3SGpIZ1VkSHNGeGxkY2lWaWxiL0Q1RjQ2dXVFSGNadU8zVkxXM2wx?= =?utf-8?B?ajhmYm1YRFFxNjlQVFBjRE8xY0VxV1R4TE9Mb3ZZY1Rvb0pkZjh4TnF3RUxK?= =?utf-8?B?VFowNjNPZVZ5WmtzTzh0cExUWHgyU0crSFExdDltdEw0VENHWVJjM1FwV3hj?= =?utf-8?B?Y2tnTjBLQUVlRFdnRVpMaERheHRIZEhadlBvVEs1TVdVRURDYnZTQ2FJblBr?= =?utf-8?B?RmxkR1ZpbVlJeWFCOUw3MHQyb0JCeW5oWlRTM0x1czZDUEE2TFEwdDFBbm1j?= =?utf-8?B?a1Z4VFVzUm95R0EyUGk0a3dqaS9hWFdmUGxHbUpTSnRDMGxFblZTdldoZlpl?= =?utf-8?B?a1lYei93aGc0YThFMnRpR1BGK3dyVWNxODJpK2tRWTFzZ2NyekxCd25hQkMv?= =?utf-8?B?b3NTOUFmcmFmSktObTZXWm5SWExQM0V1aVFwSTBiRFFwc2hMK2JRL1JlVzRM?= =?utf-8?B?MDREUU5GdGc5VVlGMzZRQXgxR0VhUkFpV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?= X-Forefront-PRVS: 0340850FCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39850400002)(39860400002)(39400400002)(39840400002)(39410400002)(4326008)(103116003)(33646002)(1076002)(53416004)(42186005)(230700001)(4001350100001)(6506006)(83506001)(53936002)(66066001)(2950100002)(38730400002)(575784001)(54356999)(110136004)(50986999)(81166006)(7736002)(189998001)(3846002)(23676002)(25786009)(8676002)(72206003)(47776003)(86362001)(7406005)(7416002)(2906002)(6116002)(55016002)(5660300001)(50466002)(305945005)(54906002)(76176999)(478600001)(9686003)(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?MTtETTVQUjEyTUIxMTQ3OzIzOk5zWDU4djdQMDJsbW9IOWRGNDY5TXlzd1la?= =?utf-8?B?ZTNiVWppaHdiS3Z5SWxtZ2ZFWTRRaVRFQjF1cG5CZmhUTDg4TExXV1NZa1o5?= =?utf-8?B?cTl1aVQxSG5RVTBxZ3NneFRpcUtxUEI3dGZkT08xUVNPUXpIT1hYMDY2a3JL?= =?utf-8?B?MDdSdlFLWkxHTnFQNFAzallSVStqNDBvaU5HdFNUV3VaMkFTYjd0TTVMNkdU?= =?utf-8?B?bDFhR2hOemlrSHJkWGNsSC9waHprcDY3V3BEclh5eUkyTTFJaDh2QnZ6Qm80?= =?utf-8?B?eTYyT01VSWJSSytMbml4SFF0VE9LQkxoZ09qMnZNM1cxdWRyUFErWjJ2bTBZ?= =?utf-8?B?dHRlYTd1Wk43MGtyMFJQVHF2YldCTnBPS0JHV0o1WXRnVUtXWlJoWEJ3a0Np?= =?utf-8?B?cUowdnZzRm5KdG5iR2orUWJ0VDFaQnBpbGVEa3phSzByY1I2OGlzb2ZSWjdY?= =?utf-8?B?RkRHQkxON0xQVVFUQnZnVk1SejdjcE9XZGxSczZuWVlvaG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Fabj6kQU0eHzUdP71UQrHYHyqroTKeEUr9STJ/TMvhTuorcqPdSHrE2TJMIHk5bXtSP8uEjDsL07USXel5XWF97MbMMaiD5mCH0VRtuvTorfOIPyZpaeox2z1lWA0VqCaldSeYjxVYEtNWcrvuuJ+fVMM8XRQTkafGOWds2MSmBzd5kn8Wq3X3sYCZlmtaap0LfihMflvIUPa5eGPVR/JXT0cGDcY7IFUctYOfKZj12l10ID3LkaG66o/3Vf+mEusiAzjpW2P+lU0R+EkF/3WDuFrmd97QD1QbPMum7uC8kmCDnFQ9OZO3TCPSv/CbmJQlah0yzkt+qOQhqXFNNDF9AVdfMPaZ7hc4ZXD+qoyOXtc7L7SwlB/Rfy1qmI97+HuB3IfnhyP/Zc= X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1147; 20:0V9BqtzHwJa1XJ7FlB4iRdcnQmrzKRg/C9LGhhPxgbjmd2wSbgQ3/AYU0QNO9db+ROftESg6HJobf9tNO8R64+WvQ0LC6DsJaIIT+RJNUK8hRTkSq9FgBgG0L/iY7aigNg+lIY7J375OxL83V4khUe/n5ThUEc3iHzU1837vPGhNUTiEN/QttnLDIyscse37WQSZr9+xQ9gydimvclGcbqxRMEl1gGB52FN0AUVQjiETj2iadPkpmKieQFiCMiJh X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2017 18:55:47.9170 (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 v7 31/36] 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. Signed-off-by: Tom Lendacky Reviewed-by: Borislav Petkov --- 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 | 14 ++++++++++++++ kernel/kexec_core.c | 12 +++++++++++- 8 files changed, 79 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..5d17fd6 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -334,6 +334,20 @@ 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);