-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv, crash: don't export some symbols when CONFIG_MMU=n #339
Conversation
Upstream branch: 3ca112b |
Upstream branch: b85ea95 |
b3ca91d
to
65c615a
Compare
Upstream branch: 6c31291 |
65c615a
to
a3afb00
Compare
Upstream branch: f352a28 |
a3afb00
to
fb4b0c4
Compare
Upstream branch: f352a28 |
fb4b0c4
to
e28f5d5
Compare
When dropping select of KEXEC and dependency on ARCH_SUPPORTS_KEXEC from CRASH_DUMP, compiling error is reported when below config items are set: ----------------------- CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y ...... ----------------------- ------------------------------------------------------------------------------------------------- arch/riscv/kernel/crash_core.c:8:27: error: 'VA_BITS' undeclared (first use in this function) 8 | VMCOREINFO_NUMBER(VA_BITS); | ^~~~~~~ include/linux/crash_core.h:78:64: note: in definition of macro 'VMCOREINFO_NUMBER' 78 | vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) | ^~~~ arch/riscv/kernel/crash_core.c:14:64: error: 'VMEMMAP_START' undeclared (first use in this function) 14 | vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START); | ^~~~~~~~~~~~~ arch/riscv/kernel/crash_core.c:15:62: error: 'VMEMMAP_END' undeclared (first use in this function); did you mean 'MEMREMAP_ENC'? 15 | vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END); | ^~~~~~~~~~~ | MEMREMAP_ENC arch/riscv/kernel/crash_core.c:17:64: error: 'MODULES_VADDR' undeclared (first use in this function) 17 | vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR); | ^~~~~~~~~~~~~ arch/riscv/kernel/crash_core.c:18:62: error: 'MODULES_END' undeclared (first use in this function) 18 | vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END); ------------------------------------------------------------------------------------------------- Currently, riscv's ARCH_SUPPORTS_KEXEC has dependency on MMU. Before dropping ARCH_SUPPORTS_KEXEC, disabling CONFIG_MMU will unset CONFIG_CRASH_DUMP, CONFIG_KEXEC_CORE, CONFIG_CRASH_CORE. Hence crash_core related codes won't be compiled. --------------------- arch/riscv/Kconfig: config ARCH_SUPPORTS_KEXEC def_bool MMU --------------------- After dropping ARCH_SUPPORTS_KEXEC, CONFIG_CRASH_DUMP, CONFIG_KEXEC_CORE, CONFIG_CRASH_CORE can be set independently of CONFIG_MMU. However, there are several macro definitions, such as VA_BITS, VMEMMAP_START, VMEMMAP_END, MODULES_VADDR, MODULES_END are only available when CONFIG_MMU=y. Then compiling errors are triggered. Here, add CONFIG_MMU ifdeffery in arch_crash_save_vmcoreinfo() to export those symbols when CONFIG_MMU is enabled. Signed-off-by: Baoquan He <bhe@redhat.com> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Baoquan He <bhe@redhat.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Drop the dependency on MMU from ARCH_SUPPORTS_KEXEC and ARCH_SUPPORTS_KEXEC_FILE because CONFIG_MMU could be disabled while people may still want to have KEXEC/KEXEC_FILE functionality. Signed-off-by: Baoquan He <bhe@redhat.com> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
Upstream branch: 5a2cf77 |
e28f5d5
to
fa8c4ba
Compare
Pull request for series with
subject: riscv, crash: don't export some symbols when CONFIG_MMU=n
version: 1
url: https://patchwork.kernel.org/project/linux-riscv/list/?series=806442