| From | "Kirill A. Shutemov" <> | Subject | [PATCHv7 11/14] x86: Disable kexec if system has unaccepted memory | Date | Tue, 14 Jun 2022 15:02:28 +0300 |
| |
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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/arch/x86/mm/unaccepted_memory.c b/arch/x86/mm/unaccepted_memory.c index bcd56fe82b9e..05e216716690 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> @@ -95,3 +96,21 @@ bool range_contains_unaccepted_memory(phys_addr_t start, phys_addr_t end) return ret; } + +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 + + return 0; +} +fs_initcall(unaccepted_init); -- 2.35.1
|