lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCHv6 11/15] x86: Disable kexec if system has unaccepted memory
Date
On kexec, the target kernel has to know what memory has been accepted.
Information in EFI map is out of date and cannot be used.

boot_params.unaccepted_memory can be used to pass the bitmap between two
kernels on kexec, but the use-case is not yet implemented.

Disable kexec on machines with unaccepted memory for now.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
arch/x86/mm/unaccepted_memory.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/x86/mm/unaccepted_memory.c b/arch/x86/mm/unaccepted_memory.c
index 1ca71eb98c24..b4c43e6089b0 100644
--- a/arch/x86/mm/unaccepted_memory.c
+++ b/arch/x86/mm/unaccepted_memory.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
+#include <linux/kexec.h>
#include <linux/memblock.h>
#include <linux/mm.h>
#include <linux/pfn.h>
@@ -114,6 +115,15 @@ static int __init unaccepted_init(void)
if (!boot_params.unaccepted_memory)
return 0;

+#ifdef CONFIG_KEXEC_CORE
+ /*
+ * TODO: Information on memory acceptance status has to be communicated
+ * between kernel.
+ */
+ pr_warn("Disable kexec: not yet supported on systems with unaccepted memory\n");
+ kexec_load_disabled = 1;
+#endif
+
bitmap_size = e820__end_of_ram_pfn() * PAGE_SIZE / PMD_SIZE;
unaccepted_memory = __va(boot_params.unaccepted_memory);

--
2.35.1
\
 
 \ /
  Last update: 2022-05-17 17:37    [W:0.289 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site