[PATCH v2 5/8] crash_core.h: include <asm/crash_core.h> if generic reservation is needed

Baoquan He bhe at redhat.com
Tue Aug 29 05:16:07 PDT 2023


In asm/crash_core.h, ARCH can provide its own macro definitions to
override DEFAULT_CRASH_KERNEL_LOW_SIZE, CRASH_ALIGN, CRASH_ADDR_LOW_MAX,
CRASH_ADDR_HIGH_MAX in <linux/crash_core.h> if needed.

Later, x86 and arm64 wil support the generic reservaton, so wrap the
including into CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION ifdeffery
scope to avoid compiling error in other ARCH-es which doesn't take the
generic reservation.

Signed-off-by: Baoquan He <bhe at redhat.com>
---
 include/linux/crash_core.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
index 2f732493e922..86e22e6a039f 100644
--- a/include/linux/crash_core.h
+++ b/include/linux/crash_core.h
@@ -5,6 +5,9 @@
 #include <linux/linkage.h>
 #include <linux/elfcore.h>
 #include <linux/elf.h>
+#ifdef CONFIG_ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
+#include <asm/crash_core.h>
+#endif
 
 #define CRASH_CORE_NOTE_NAME	   "CORE"
 #define CRASH_CORE_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
-- 
2.41.0




More information about the kexec mailing list