Re: [PATCH v2 6/8] x86: kdump: use generic interface to simplify crashkernel reservation code

From: Baoquan He
Date: Wed Aug 30 2023 - 14:58:53 EST


On 08/30/23 at 09:49am, kernel test robot wrote:
> Hi Baoquan,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on arm64/for-next/core]
> [also build test ERROR on tip/x86/core powerpc/next powerpc/fixes v6.5]
> [cannot apply to linus/master next-20230829]
> [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/crash_core-c-remove-unnecessary-parameter-of-function/20230829-201942
> base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
> patch link: https://lore.kernel.org/r/20230829121610.138107-7-bhe%40redhat.com
> patch subject: [PATCH v2 6/8] x86: kdump: use generic interface to simplify crashkernel reservation code
> config: x86_64-randconfig-r022-20230830 (https://download.01.org/0day-ci/archive/20230830/202308300910.e0i4piJT-lkp@xxxxxxxxx/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230830/202308300910.e0i4piJT-lkp@xxxxxxxxx/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@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202308300910.e0i4piJT-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>):
>
> ld: vmlinux.o: in function `reserve_crashkernel_low':
> kernel/crash_core.c:369: undefined reference to `crashk_low_res'
> ld: kernel/crash_core.c:369: undefined reference to `crashk_low_res'
> ld: kernel/crash_core.c:370: undefined reference to `crashk_low_res'
> ld: kernel/crash_core.c:369: undefined reference to `crashk_low_res'
> ld: kernel/crash_core.c:370: undefined reference to `crashk_low_res'
> ld: vmlinux.o:kernel/crash_core.c:371: more undefined references to `crashk_low_res' follow
> ld: vmlinux.o: in function `reserve_crashkernel_generic':
> >> kernel/crash_core.c:453: undefined reference to `crashk_res'
> >> ld: kernel/crash_core.c:453: undefined reference to `crashk_res'
> ld: kernel/crash_core.c:454: undefined reference to `crashk_res'
> >> ld: kernel/crash_core.c:453: undefined reference to `crashk_res'
> ld: kernel/crash_core.c:454: undefined reference to `crashk_res'
> ld: vmlinux.o:kernel/crash_core.c:454: more undefined references to `crashk_res' follow

Thanks for reporting. This one has the same root cause as the i386-randconfig
building. It's because crashk_res|crashk_low_res are defined in
kernel/kexec_core.c, but referenced in generic reservation code in
crash_core.c, while in this lkp's randconfig, CONFIG_KEXEC_CORE is
unset, CONFIG_CRASH_CORE=on. Then undefined reference to `crashk_res'
and `crashk_low_res' are reported.

Below patch can fix it. I will post v3 to contain this.