Skip to content

Commit dccf78d

Browse files
Baoquan Heakpm00
authored andcommitted
kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP
Ignat Korchagin complained that a potential config regression was introduced by commit 89cde45 ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Before the commit, CONFIG_CRASH_DUMP has no dependency on CONFIG_KEXEC. After the commit, CRASH_DUMP selects KEXEC. That enforces system to have CONFIG_KEXEC=y as long as CONFIG_CRASH_DUMP=Y which people may not want. In Ignat's case, he sets CONFIG_CRASH_DUMP=y, CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=n because kexec_load interface could have security issue if kernel/initrd has no chance to be signed and verified. CRASH_DUMP has select of KEXEC because Eric, author of above commit, met a LKP report of build failure when posting patch of earlier version. Please see below link to get detail of the LKP report: https://lore.kernel.org/all/[email protected]/T/#u In fact, that LKP report is triggered because arm's <asm/kexec.h> is wrapped in CONFIG_KEXEC ifdeffery scope. That is wrong. CONFIG_KEXEC controls the enabling/disabling of kexec_load interface, but not kexec feature. Removing the wrongly added CONFIG_KEXEC ifdeffery scope in <asm/kexec.h> of arm allows us to drop the select KEXEC for CRASH_DUMP. Meanwhile, change arch/arm/kernel/Makefile to let machine_kexec.o relocate_kernel.o depend on KEXEC_CORE. Link: https://lkml.kernel.org/r/[email protected] Fixes: 89cde45 ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec") Signed-off-by: Baoquan He <[email protected]> Reported-by: Ignat Korchagin <[email protected]> Tested-by: Ignat Korchagin <[email protected]> [compile-time only] Tested-by: Alexander Gordeev <[email protected]> Reviewed-by: Eric DeVolder <[email protected]> Tested-by: Eric DeVolder <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8e92157 commit dccf78d

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

arch/arm/include/asm/kexec.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef _ARM_KEXEC_H
33
#define _ARM_KEXEC_H
44

5-
#ifdef CONFIG_KEXEC
6-
75
/* Maximum physical address we can use pages from */
86
#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
97
/* Maximum address we can reach in physical address mode */
@@ -82,6 +80,4 @@ static inline struct page *boot_pfn_to_page(unsigned long boot_pfn)
8280

8381
#endif /* __ASSEMBLY__ */
8482

85-
#endif /* CONFIG_KEXEC */
86-
8783
#endif /* _ARM_KEXEC_H */

arch/arm/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ obj-$(CONFIG_FUNCTION_TRACER) += entry-ftrace.o
5959
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o patch.o
6060
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o patch.o
6161
obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o
62-
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
62+
obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o
6363
# Main staffs in KPROBES are in arch/arm/probes/ .
6464
obj-$(CONFIG_KPROBES) += patch.o insn.o
6565
obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o

kernel/Kconfig.kexec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ config CRASH_DUMP
9797
depends on ARCH_SUPPORTS_KEXEC
9898
select CRASH_CORE
9999
select KEXEC_CORE
100-
select KEXEC
101100
help
102101
Generate crash dump after being started by kexec.
103102
This should be normally only set in special crash dump kernels

0 commit comments

Comments
 (0)