sophgo / linux-riscv

Linux kernel stable tree
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
Other
23 stars 47 forks source link

riscv: kexec: Gate kexec image loader with CONFIG_CRASH_DUMP #116

Closed silvanshade closed 3 months ago

silvanshade commented 4 months ago

This commit fixes the kernel build when CONFIG_CRASH_DUMP is not enabled. /cc @xingxg2022

xingxg2022 commented 4 months ago

CONFIG_KEXEC_FILE depends on CONFIG_CRASH_DUMP. if you want to disable CONFIG_CRASH_DUMP, please also disable CONFIG_KEXEC_FILE.

silvanshade commented 4 months ago

CONFIG_KEXEC_FILE depends on CONFIG_CRASH_DUMP.

Are you sure this is the case? The definition of KEXEC_FILE does not seem to have a depends on CRASH_DUMP:

https://github.com/sophgo/linux-riscv/blob/93f987b13bc54332efd6f9cf95f4b62e2f7768eb/kernel/Kconfig.kexec#L38-L48

and:

https://github.com/sophgo/linux-riscv/blob/93f987b13bc54332efd6f9cf95f4b62e2f7768eb/kernel/Kconfig.kexec#L11-L12

Without this change, compiling without CONFIG_CRASH_DUMP will cause undeclared function errors.

xingxg2022 commented 4 months ago

elf_kexec.c and image_kexec.c under arch/riscv/kernel directory both call some functions defined in kexec/crash_core.c. This is an implicit dependency and it is not reflected in Kconfig.

silvanshade commented 3 months ago

@xingxg2022 Why did you close it? I was planning to modify with your suggestion.