diff mbox series

[5/5] crash: clean up CRASH_DUMP

Message ID 20240105103305.557273-6-bhe@redhat.com (mailing list archive)
State Handled Elsewhere
Headers show
Series crash: clean up kdump related config items | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_sparse fail 2 of 4 jobs failed.
snowpatch_ozlabs/github-powerpc_clang fail 6 of 6 jobs failed.
snowpatch_ozlabs/github-powerpc_kernel_qemu fail kernel (g5_defconfig, fedora-38, /linux/arch/powerpc/configs/g5-qemu.config) failed at step Build.
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.

Commit Message

Baoquan He Jan. 5, 2024, 10:33 a.m. UTC
By splitting CRASH_CORE into CRASH_RESERVE and VMCORE_INFO, and cleaning
up the dependency of FA_DMUMP on CRASH_DUMP, now we can rearrange CRASH_DUMP
to depend on KEXEC_CORE, and select CRASH_RESERVE and VMCORE_INFO.

KEXEC_CORE won't select CRASH_RESERVE and VMCORE_INFO any more because
KEXEC_CORE enables codes which allocate control pages, copy
kexec/kdump segments, and prepare for switching. These codes are shared
by both kexec_load and kexec_file_load, and by both kexec reboot and
kdump.

Doing this to make codes and the corresponding config items more
logical.

PROC_KCORE -----------> VMCORE_INFO

           |----------> VMCORE_INFO
FA_DUMP----|
           |----------> CRASH_RESERVE

                                                ---->VMCORE_INFO
                                               /
                                               |---->CRASH_RESERVE
KEXEC      --|                                /|
             |--> KEXEC_CORE--> CRASH_DUMP-->/-|---->PROC_VMCORE
KEXEC_FILE --|                               \ |
                                               \---->CRASH_HOTPLUG

KEXEC      --|
             |--> KEXEC_CORE--> kexec reboot
KEXEC_FILE --|

Previously, LKP reported a building error. When investigating, it can't
be resolved reasonablly with the present messy kdump config items. With
the prepartory patches and chaneg at above, the LKP reported issue can
be solved now.

Signed-off-by: Baoquan He <bhe@redhat.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312182200.Ka7MzifQ-lkp@intel.com/
---
 kernel/Kconfig.kexec | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

kernel test robot Jan. 7, 2024, 1:19 p.m. UTC | #1
Hi Baoquan,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.7-rc8]
[cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
base:   linus/master
patch link:    https://lore.kernel.org/r/20240105103305.557273-6-bhe%40redhat.com
patch subject: [PATCH 5/5] crash: clean up CRASH_DUMP
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-122-20240106 (https://download.01.org/0day-ci/archive/20240107/202401071326.52yn9Ftd-lkp@intel.com/config)
compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240107/202401071326.52yn9Ftd-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202401071326.52yn9Ftd-lkp@intel.com/

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: crashk_res
   >>> referenced by initramfs.c:638 (init/initramfs.c:638)
   >>>               init/initramfs.o:(kexec_free_initrd) in archive vmlinux.a
   >>> referenced by initramfs.c:638 (init/initramfs.c:638)
   >>>               init/initramfs.o:(kexec_free_initrd) in archive vmlinux.a
   >>> referenced by initramfs.c:0 (init/initramfs.c:0)
   >>>               init/initramfs.o:(kexec_free_initrd) in archive vmlinux.a
   >>> referenced 77 more times
--
>> ld.lld: error: undefined symbol: parse_crashkernel
   >>> referenced by setup.c:479 (arch/x86/kernel/setup.c:479)
   >>>               arch/x86/kernel/setup.o:(arch_reserve_crashkernel) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: crashk_low_res
   >>> referenced by machine_kexec_64.c:539 (arch/x86/kernel/machine_kexec_64.c:539)
   >>>               arch/x86/kernel/machine_kexec_64.o:(kexec_mark_crashkres) in archive vmlinux.a
   >>> referenced by machine_kexec_64.c:539 (arch/x86/kernel/machine_kexec_64.c:539)
   >>>               arch/x86/kernel/machine_kexec_64.o:(kexec_mark_crashkres) in archive vmlinux.a
   >>> referenced by machine_kexec_64.c:539 (arch/x86/kernel/machine_kexec_64.c:539)
   >>>               arch/x86/kernel/machine_kexec_64.o:(kexec_mark_crashkres) in archive vmlinux.a
   >>> referenced 36 more times
--
>> ld.lld: error: undefined symbol: crash_update_vmcoreinfo_safecopy
   >>> referenced by kexec_core.c:522 (kernel/kexec_core.c:522)
   >>>               kernel/kexec_core.o:(kimage_crash_copy_vmcoreinfo) in archive vmlinux.a
   >>> referenced by kexec_core.c:610 (kernel/kexec_core.c:610)
   >>>               kernel/kexec_core.o:(kimage_free) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: crash_save_vmcoreinfo
   >>> referenced by kexec_core.c:1053 (kernel/kexec_core.c:1053)
   >>>               kernel/kexec_core.o:(__crash_kexec) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: paddr_vmcoreinfo_note
   >>> referenced by kexec_core.c:1148 (kernel/kexec_core.c:1148)
   >>>               kernel/kexec_core.o:(crash_prepare_elf64_headers) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: append_elf_note
   >>> referenced by kexec_core.c:1390 (kernel/kexec_core.c:1390)
   >>>               kernel/kexec_core.o:(crash_save_cpu) in archive vmlinux.a
--
>> ld.lld: error: undefined symbol: final_note
   >>> referenced by kexec_core.c:1392 (kernel/kexec_core.c:1392)
   >>>               kernel/kexec_core.o:(crash_save_cpu) in archive vmlinux.a
Baoquan He Jan. 9, 2024, 3:49 a.m. UTC | #2
On 01/07/24 at 09:19pm, kernel test robot wrote:
> Hi Baoquan,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v6.7-rc8]
> [cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/kexec_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735
> base:   linus/master
> patch link:    https://lore.kernel.org/r/20240105103305.557273-6-bhe%40redhat.com
> patch subject: [PATCH 5/5] crash: clean up CRASH_DUMP
> :::::: branch date: 2 days ago
> :::::: commit date: 2 days ago
> config: x86_64-randconfig-122-20240106 (https://download.01.org/0day-ci/archive/20240107/202401071326.52yn9Ftd-lkp@intel.com/config)
> compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240107/202401071326.52yn9Ftd-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/r/202401071326.52yn9Ftd-lkp@intel.com/

Thanks for reporting.

I have reproduced these linking errors, will consier how to rearrange
code change and fix them. The thing splitting kdump out could be more
complicated than I thought.

> 
> All errors (new ones prefixed by >>):
> 
> >> ld.lld: error: undefined symbol: crashk_res
>    >>> referenced by initramfs.c:638 (init/initramfs.c:638)
>    >>>               init/initramfs.o:(kexec_free_initrd) in archive vmlinux.a
>    >>> referenced by initramfs.c:638 (init/initramfs.c:638)
>    >>>               init/initramfs.o:(kexec_free_initrd) in archive vmlinux.a
>    >>> referenced by initramfs.c:0 (init/initramfs.c:0)
>    >>>               init/initramfs.o:(kexec_free_initrd) in archive vmlinux.a
>    >>> referenced 77 more times
> --
> >> ld.lld: error: undefined symbol: parse_crashkernel
>    >>> referenced by setup.c:479 (arch/x86/kernel/setup.c:479)
>    >>>               arch/x86/kernel/setup.o:(arch_reserve_crashkernel) in archive vmlinux.a
> --
> >> ld.lld: error: undefined symbol: crashk_low_res
>    >>> referenced by machine_kexec_64.c:539 (arch/x86/kernel/machine_kexec_64.c:539)
>    >>>               arch/x86/kernel/machine_kexec_64.o:(kexec_mark_crashkres) in archive vmlinux.a
>    >>> referenced by machine_kexec_64.c:539 (arch/x86/kernel/machine_kexec_64.c:539)
>    >>>               arch/x86/kernel/machine_kexec_64.o:(kexec_mark_crashkres) in archive vmlinux.a
>    >>> referenced by machine_kexec_64.c:539 (arch/x86/kernel/machine_kexec_64.c:539)
>    >>>               arch/x86/kernel/machine_kexec_64.o:(kexec_mark_crashkres) in archive vmlinux.a
>    >>> referenced 36 more times
> --
> >> ld.lld: error: undefined symbol: crash_update_vmcoreinfo_safecopy
>    >>> referenced by kexec_core.c:522 (kernel/kexec_core.c:522)
>    >>>               kernel/kexec_core.o:(kimage_crash_copy_vmcoreinfo) in archive vmlinux.a
>    >>> referenced by kexec_core.c:610 (kernel/kexec_core.c:610)
>    >>>               kernel/kexec_core.o:(kimage_free) in archive vmlinux.a
> --
> >> ld.lld: error: undefined symbol: crash_save_vmcoreinfo
>    >>> referenced by kexec_core.c:1053 (kernel/kexec_core.c:1053)
>    >>>               kernel/kexec_core.o:(__crash_kexec) in archive vmlinux.a
> --
> >> ld.lld: error: undefined symbol: paddr_vmcoreinfo_note
>    >>> referenced by kexec_core.c:1148 (kernel/kexec_core.c:1148)
>    >>>               kernel/kexec_core.o:(crash_prepare_elf64_headers) in archive vmlinux.a
> --
> >> ld.lld: error: undefined symbol: append_elf_note
>    >>> referenced by kexec_core.c:1390 (kernel/kexec_core.c:1390)
>    >>>               kernel/kexec_core.o:(crash_save_cpu) in archive vmlinux.a
> --
> >> ld.lld: error: undefined symbol: final_note
>    >>> referenced by kexec_core.c:1392 (kernel/kexec_core.c:1392)
>    >>>               kernel/kexec_core.o:(crash_save_cpu) in archive vmlinux.a
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>
diff mbox series

Patch

diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec
index 8faf27043432..6c34e63c88ff 100644
--- a/kernel/Kconfig.kexec
+++ b/kernel/Kconfig.kexec
@@ -9,8 +9,6 @@  config VMCORE_INFO
 	bool
 
 config KEXEC_CORE
-	select VMCORE_INFO
-	select CRASH_RESERVE
 	bool
 
 config KEXEC_ELF
@@ -99,8 +97,11 @@  config KEXEC_JUMP
 
 config CRASH_DUMP
 	bool "kernel crash dumps"
+	default y
 	depends on ARCH_SUPPORTS_CRASH_DUMP
-	select KEXEC_CORE
+	depends on KEXEC_CORE
+	select VMCORE_INFO
+	select CRASH_RESERVE
 	help
 	  Generate crash dump after being started by kexec.
 	  This should be normally only set in special crash dump kernels