Skip to content

Commit 2c44b67

Browse files
Baoquan Heakpm00
Baoquan He
authored andcommitted
crash: remove dependency of FA_DUMP on CRASH_DUMP
In kdump kernel, /proc/vmcore is an elf file mapping the crashed kernel's old memory content. Its elf header is constructed in 1st kernel and passed to kdump kernel via elfcorehdr_addr. Config CRASH_DUMP enables the code of 1st kernel's old memory accessing in different architectures. Currently, config FA_DUMP has dependency on CRASH_DUMP because fadump needs access global variable 'elfcorehdr_addr' to judge if it's in kdump kernel within function is_kdump_kernel(). In the current kernel/crash_dump.c, variable 'elfcorehdr_addr' is defined, and function setup_elfcorehdr() used to parse kernel parameter to fetch the passed value of elfcorehdr_addr. Only for accessing elfcorehdr_addr, FA_DUMP really doesn't have to depends on CRASH_DUMP. To remove the dependency of FA_DUMP on CRASH_DUMP to avoid confusion, rename kernel/crash_dump.c to kernel/elfcorehdr.c, and build it when CONFIG_VMCORE_INFO is ebabled. With this, FA_DUMP doesn't need to depend on CRASH_DUMP. [[email protected]: power/fadump: make FA_DUMP select CRASH_DUMP] Link: https://lkml.kernel.org/r/Zb8D1ASrgX0qVm9z@MiWiFi-R3L-srv Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Baoquan He <[email protected]> Acked-by: Hari Bathini <[email protected]> Cc: Al Viro <[email protected]> Cc: Eric W. Biederman <[email protected]> Cc: Pingfan Liu <[email protected]> Cc: Klara Modin <[email protected]> Cc: Michael Kelley <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Yang Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 443cbaf commit 2c44b67

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

arch/powerpc/Kconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,6 @@ config ARCH_SELECTS_CRASH_DUMP
690690
config FA_DUMP
691691
bool "Firmware-assisted dump"
692692
depends on PPC64 && (PPC_RTAS || PPC_POWERNV)
693-
select VMCORE_INFO
694-
select CRASH_RESERVE
695693
select CRASH_DUMP
696694
help
697695
A robust mechanism to get reliable kernel crash dump with

kernel/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ obj-$(CONFIG_MODULE_SIG_FORMAT) += module_signature.o
6868
obj-$(CONFIG_KALLSYMS) += kallsyms.o
6969
obj-$(CONFIG_KALLSYMS_SELFTEST) += kallsyms_selftest.o
7070
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
71-
obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o
71+
obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o elfcorehdr.o
7272
obj-$(CONFIG_CRASH_RESERVE) += crash_reserve.o
7373
obj-$(CONFIG_KEXEC_CORE) += kexec_core.o crash_core.o
7474
obj-$(CONFIG_KEXEC) += kexec.o
@@ -121,7 +121,6 @@ obj-$(CONFIG_PERF_EVENTS) += events/
121121

122122
obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
123123
obj-$(CONFIG_PADATA) += padata.o
124-
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
125124
obj-$(CONFIG_JUMP_LABEL) += jump_label.o
126125
obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
127126
obj-$(CONFIG_TORTURE_TEST) += torture.o
File renamed without changes.

kernel/kexec_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include <linux/kexec.h>
66

7+
struct kexec_segment;
8+
79
struct kimage *do_kimage_alloc_init(void);
810
int sanity_check_segment_list(struct kimage *image);
911
void kimage_free_page_list(struct list_head *list);

0 commit comments

Comments
 (0)