public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
       [not found] <20240105103305.557273-2-bhe@redhat.com>
@ 2024-01-06 14:58 ` kernel test robot
  2024-01-07  8:52   ` Baoquan He
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-01-06 14:58 UTC (permalink / raw)
  To: Baoquan He, linux-kernel
  Cc: llvm, oe-kbuild-all, akpm, kexec, hbathini, arnd, ignat,
	eric_devolder, viro, ebiederm, x86, linux-arm-kernel,
	linuxppc-dev, linux-riscv, linux-fsdevel, Baoquan He

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-2-bhe%40redhat.com
patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240106/202401062212.LXqinfjE-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/20240106/202401062212.LXqinfjE-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/oe-kbuild-all/202401062212.LXqinfjE-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/x86/kernel/crash.c:154:17: error: invalid application of 'sizeof' to an incomplete type 'struct crash_mem'
     154 |         cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:293:9: note: expanded from macro 'struct_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                       ^~~~~~
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
>> arch/x86/kernel/crash.c:154:17: error: incomplete definition of type 'struct crash_mem'
     154 |         cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:293:18: note: expanded from macro 'struct_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:277:24: note: expanded from macro 'flex_array_size'
     277 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                   ~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
>> arch/x86/kernel/crash.c:154:17: error: incomplete definition of type 'struct crash_mem'
     154 |         cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:293:18: note: expanded from macro 'struct_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:277:55: note: expanded from macro 'flex_array_size'
     277 |                 (count) * sizeof(*(p)->member) + __must_be_array((p)->member),  \
         |                                                  ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   include/linux/compiler.h:228:59: note: expanded from macro '__must_be_array'
     228 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compiler_types.h:376:63: note: expanded from macro '__same_type'
     376 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                                                               ^
   include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                              ^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
>> arch/x86/kernel/crash.c:154:17: error: incomplete definition of type 'struct crash_mem'
     154 |         cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:293:18: note: expanded from macro 'struct_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:278:30: note: expanded from macro 'flex_array_size'
     278 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                         ~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
>> arch/x86/kernel/crash.c:154:17: error: incomplete definition of type 'struct crash_mem'
     154 |         cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:293:18: note: expanded from macro 'struct_size'
     293 |                 sizeof(*(p)) + flex_array_size(p, member, count),       \
         |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/overflow.h:278:61: note: expanded from macro 'flex_array_size'
     278 |                 size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member)))
         |                                                        ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
   include/linux/compiler.h:228:59: note: expanded from macro '__must_be_array'
     228 | #define __must_be_array(a)      BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
         |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compiler_types.h:376:63: note: expanded from macro '__same_type'
     376 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
         |                                                               ^
   include/linux/build_bug.h:16:62: note: expanded from macro 'BUILD_BUG_ON_ZERO'
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                              ^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:158:6: error: incomplete definition of type 'struct crash_mem'
     158 |         cmem->max_nr_ranges = nr_ranges;
         |         ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:159:6: error: incomplete definition of type 'struct crash_mem'
     159 |         cmem->nr_ranges = 0;
         |         ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
>> arch/x86/kernel/crash.c:173:8: error: call to undeclared function 'crash_exclude_mem_range'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     173 |         ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
         |               ^
   arch/x86/kernel/crash.c:193:6: error: incomplete definition of type 'struct crash_mem'
     193 |         cmem->ranges[cmem->nr_ranges].start = res->start;
         |         ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:193:19: error: incomplete definition of type 'struct crash_mem'
     193 |         cmem->ranges[cmem->nr_ranges].start = res->start;
         |                      ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:194:6: error: incomplete definition of type 'struct crash_mem'
     194 |         cmem->ranges[cmem->nr_ranges].end = res->end;
         |         ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:194:19: error: incomplete definition of type 'struct crash_mem'
     194 |         cmem->ranges[cmem->nr_ranges].end = res->end;
         |                      ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:195:6: error: incomplete definition of type 'struct crash_mem'
     195 |         cmem->nr_ranges++;
         |         ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
   arch/x86/kernel/crash.c:221:23: error: incomplete definition of type 'struct crash_mem'
     221 |         *nr_mem_ranges = cmem->nr_ranges;
         |                          ~~~~^
   arch/x86/kernel/crash.c:140:15: note: forward declaration of 'struct crash_mem'
     140 | static struct crash_mem *fill_up_crash_elf_data(void)
         |               ^
>> arch/x86/kernel/crash.c:224:9: error: call to undeclared function 'crash_prepare_elf64_headers'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     224 |         ret =  crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
         |                ^
   arch/x86/kernel/crash.c:224:9: note: did you mean 'prepare_elf_headers'?
   arch/x86/kernel/crash.c:201:12: note: 'prepare_elf_headers' declared here
     201 | static int prepare_elf_headers(struct kimage *image, void **addr,
         |            ^
   15 errors generated.


vim +154 arch/x86/kernel/crash.c

dd5f726076cc76 Vivek Goyal         2014-08-08  138  
dd5f726076cc76 Vivek Goyal         2014-08-08  139  /* Gather all the required information to prepare elf headers for ram regions */
8d5f894a3108ac AKASHI Takahiro     2018-04-13 @140  static struct crash_mem *fill_up_crash_elf_data(void)
dd5f726076cc76 Vivek Goyal         2014-08-08  141  {
dd5f726076cc76 Vivek Goyal         2014-08-08  142  	unsigned int nr_ranges = 0;
8d5f894a3108ac AKASHI Takahiro     2018-04-13  143  	struct crash_mem *cmem;
dd5f726076cc76 Vivek Goyal         2014-08-08  144  
9eff303725da65 Borislav Petkov     2019-11-14  145  	walk_system_ram_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback);
8d5f894a3108ac AKASHI Takahiro     2018-04-13  146  	if (!nr_ranges)
8d5f894a3108ac AKASHI Takahiro     2018-04-13  147  		return NULL;
dd5f726076cc76 Vivek Goyal         2014-08-08  148  
8d5f894a3108ac AKASHI Takahiro     2018-04-13  149  	/*
8d5f894a3108ac AKASHI Takahiro     2018-04-13  150  	 * Exclusion of crash region and/or crashk_low_res may cause
8d5f894a3108ac AKASHI Takahiro     2018-04-13  151  	 * another range split. So add extra two slots here.
8d5f894a3108ac AKASHI Takahiro     2018-04-13  152  	 */
8d5f894a3108ac AKASHI Takahiro     2018-04-13  153  	nr_ranges += 2;
4df4309587e18a Gustavo A. R. Silva 2019-04-03 @154  	cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
8d5f894a3108ac AKASHI Takahiro     2018-04-13  155  	if (!cmem)
8d5f894a3108ac AKASHI Takahiro     2018-04-13  156  		return NULL;
dd5f726076cc76 Vivek Goyal         2014-08-08  157  
8d5f894a3108ac AKASHI Takahiro     2018-04-13  158  	cmem->max_nr_ranges = nr_ranges;
8d5f894a3108ac AKASHI Takahiro     2018-04-13  159  	cmem->nr_ranges = 0;
dd5f726076cc76 Vivek Goyal         2014-08-08  160  
8d5f894a3108ac AKASHI Takahiro     2018-04-13  161  	return cmem;
dd5f726076cc76 Vivek Goyal         2014-08-08  162  }
dd5f726076cc76 Vivek Goyal         2014-08-08  163  
dd5f726076cc76 Vivek Goyal         2014-08-08  164  /*
dd5f726076cc76 Vivek Goyal         2014-08-08  165   * Look for any unwanted ranges between mstart, mend and remove them. This
8d5f894a3108ac AKASHI Takahiro     2018-04-13  166   * might lead to split and split ranges are put in cmem->ranges[] array
dd5f726076cc76 Vivek Goyal         2014-08-08  167   */
8d5f894a3108ac AKASHI Takahiro     2018-04-13  168  static int elf_header_exclude_ranges(struct crash_mem *cmem)
dd5f726076cc76 Vivek Goyal         2014-08-08  169  {
dd5f726076cc76 Vivek Goyal         2014-08-08  170  	int ret = 0;
dd5f726076cc76 Vivek Goyal         2014-08-08  171  
7c321eb2b843bf Lianbo Jiang        2019-11-08  172  	/* Exclude the low 1M because it is always reserved */
a3e1c3bb24e2ff Lianbo Jiang        2020-08-04 @173  	ret = crash_exclude_mem_range(cmem, 0, (1<<20)-1);
7c321eb2b843bf Lianbo Jiang        2019-11-08  174  	if (ret)
7c321eb2b843bf Lianbo Jiang        2019-11-08  175  		return ret;
7c321eb2b843bf Lianbo Jiang        2019-11-08  176  
dd5f726076cc76 Vivek Goyal         2014-08-08  177  	/* Exclude crashkernel region */
babac4a84a8884 AKASHI Takahiro     2018-04-13  178  	ret = crash_exclude_mem_range(cmem, crashk_res.start, crashk_res.end);
dd5f726076cc76 Vivek Goyal         2014-08-08  179  	if (ret)
dd5f726076cc76 Vivek Goyal         2014-08-08  180  		return ret;
dd5f726076cc76 Vivek Goyal         2014-08-08  181  
9eff303725da65 Borislav Petkov     2019-11-14  182  	if (crashk_low_res.end)
babac4a84a8884 AKASHI Takahiro     2018-04-13  183  		ret = crash_exclude_mem_range(cmem, crashk_low_res.start,
babac4a84a8884 AKASHI Takahiro     2018-04-13  184  					      crashk_low_res.end);
dd5f726076cc76 Vivek Goyal         2014-08-08  185  
dd5f726076cc76 Vivek Goyal         2014-08-08  186  	return ret;
dd5f726076cc76 Vivek Goyal         2014-08-08  187  }
dd5f726076cc76 Vivek Goyal         2014-08-08  188  
1d2e733b13b450 Tom Lendacky        2017-10-20  189  static int prepare_elf64_ram_headers_callback(struct resource *res, void *arg)
dd5f726076cc76 Vivek Goyal         2014-08-08  190  {
8d5f894a3108ac AKASHI Takahiro     2018-04-13  191  	struct crash_mem *cmem = arg;
dd5f726076cc76 Vivek Goyal         2014-08-08  192  
cbe6601617302b AKASHI Takahiro     2018-04-13  193  	cmem->ranges[cmem->nr_ranges].start = res->start;
cbe6601617302b AKASHI Takahiro     2018-04-13  194  	cmem->ranges[cmem->nr_ranges].end = res->end;
cbe6601617302b AKASHI Takahiro     2018-04-13  195  	cmem->nr_ranges++;
dd5f726076cc76 Vivek Goyal         2014-08-08  196  
cbe6601617302b AKASHI Takahiro     2018-04-13  197  	return 0;
dd5f726076cc76 Vivek Goyal         2014-08-08  198  }
dd5f726076cc76 Vivek Goyal         2014-08-08  199  
dd5f726076cc76 Vivek Goyal         2014-08-08  200  /* Prepare elf headers. Return addr and size */
dd5f726076cc76 Vivek Goyal         2014-08-08  201  static int prepare_elf_headers(struct kimage *image, void **addr,
ea53ad9cf73b6b Eric DeVolder       2023-08-14  202  					unsigned long *sz, unsigned long *nr_mem_ranges)
dd5f726076cc76 Vivek Goyal         2014-08-08  203  {
8d5f894a3108ac AKASHI Takahiro     2018-04-13  204  	struct crash_mem *cmem;
7c321eb2b843bf Lianbo Jiang        2019-11-08  205  	int ret;
dd5f726076cc76 Vivek Goyal         2014-08-08  206  
8d5f894a3108ac AKASHI Takahiro     2018-04-13  207  	cmem = fill_up_crash_elf_data();
8d5f894a3108ac AKASHI Takahiro     2018-04-13  208  	if (!cmem)
dd5f726076cc76 Vivek Goyal         2014-08-08  209  		return -ENOMEM;
dd5f726076cc76 Vivek Goyal         2014-08-08  210  
9eff303725da65 Borislav Petkov     2019-11-14  211  	ret = walk_system_ram_res(0, -1, cmem, prepare_elf64_ram_headers_callback);
cbe6601617302b AKASHI Takahiro     2018-04-13  212  	if (ret)
cbe6601617302b AKASHI Takahiro     2018-04-13  213  		goto out;
cbe6601617302b AKASHI Takahiro     2018-04-13  214  
cbe6601617302b AKASHI Takahiro     2018-04-13  215  	/* Exclude unwanted mem ranges */
8d5f894a3108ac AKASHI Takahiro     2018-04-13  216  	ret = elf_header_exclude_ranges(cmem);
cbe6601617302b AKASHI Takahiro     2018-04-13  217  	if (ret)
cbe6601617302b AKASHI Takahiro     2018-04-13  218  		goto out;
cbe6601617302b AKASHI Takahiro     2018-04-13  219  
ea53ad9cf73b6b Eric DeVolder       2023-08-14  220  	/* Return the computed number of memory ranges, for hotplug usage */
ea53ad9cf73b6b Eric DeVolder       2023-08-14  221  	*nr_mem_ranges = cmem->nr_ranges;
ea53ad9cf73b6b Eric DeVolder       2023-08-14  222  
dd5f726076cc76 Vivek Goyal         2014-08-08  223  	/* By default prepare 64bit headers */
9eff303725da65 Borislav Petkov     2019-11-14 @224  	ret =  crash_prepare_elf64_headers(cmem, IS_ENABLED(CONFIG_X86_64), addr, sz);
cbe6601617302b AKASHI Takahiro     2018-04-13  225  
cbe6601617302b AKASHI Takahiro     2018-04-13  226  out:
8d5f894a3108ac AKASHI Takahiro     2018-04-13  227  	vfree(cmem);
dd5f726076cc76 Vivek Goyal         2014-08-08  228  	return ret;
dd5f726076cc76 Vivek Goyal         2014-08-08  229  }
ea53ad9cf73b6b Eric DeVolder       2023-08-14  230  #endif
dd5f726076cc76 Vivek Goyal         2014-08-08  231  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
  2024-01-06 14:58 ` [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c kernel test robot
@ 2024-01-07  8:52   ` Baoquan He
  0 siblings, 0 replies; 2+ messages in thread
From: Baoquan He @ 2024-01-07  8:52 UTC (permalink / raw)
  To: kernel test robot
  Cc: linux-kernel, llvm, oe-kbuild-all, akpm, kexec, hbathini, arnd,
	ignat, eric_devolder, viro, ebiederm, x86, linux-arm-kernel,
	linuxppc-dev, linux-riscv, linux-fsdevel

On 01/06/24 at 10:58pm, 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-2-bhe%40redhat.com
> patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c
> config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240106/202401062212.LXqinfjE-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/20240106/202401062212.LXqinfjE-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/oe-kbuild-all/202401062212.LXqinfjE-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
> >> arch/x86/kernel/crash.c:154:17: error: invalid application of 'sizeof' to an incomplete type 'struct crash_mem'
>      154 |         cmem = vzalloc(struct_size(cmem, ranges, nr_ranges));
>          |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks for reporting.

I mistakenly put the struct crash_mem definition and the two function
delcarations inside CONFIG_KEXEC_FILE ifdeffery scope, so with the lkp's
config as below, the compiling failed. The code change at bottom can fix
it. Will update patch in v2.

#
# Kexec and crash features
#
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC=y
# CONFIG_KEXEC_FILE is not set
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y
CONFIG_CRASH_MAX_MEMORY_RANGES=8192

---
 include/linux/kexec.h | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index be1e5c2fdbdc..4df6ef72db84 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -228,21 +228,6 @@ static inline int arch_kexec_locate_mem_hole(struct kexec_buf *kbuf)
 }
 #endif
 
-/* Alignment required for elf header segment */
-#define ELF_CORE_HEADER_ALIGN   4096
-
-struct crash_mem {
-	unsigned int max_nr_ranges;
-	unsigned int nr_ranges;
-	struct range ranges[] __counted_by(max_nr_ranges);
-};
-
-extern int crash_exclude_mem_range(struct crash_mem *mem,
-				   unsigned long long mstart,
-				   unsigned long long mend);
-extern int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map,
-				       void **addr, unsigned long *sz);
-
 #ifndef arch_kexec_apply_relocations_add
 /*
  * arch_kexec_apply_relocations_add - apply relocations of type RELA
@@ -525,6 +510,20 @@ static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; }
 #define KEXEC_CRASH_HP_INVALID_CPU		-1U
 #endif
 
+/* Alignment required for elf header segment */
+#define ELF_CORE_HEADER_ALIGN   4096
+
+struct crash_mem {
+	unsigned int max_nr_ranges;
+	unsigned int nr_ranges;
+	struct range ranges[] __counted_by(max_nr_ranges);
+};
+
+extern int crash_exclude_mem_range(struct crash_mem *mem,
+				   unsigned long long mstart,
+				   unsigned long long mend);
+extern int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map,
+				       void **addr, unsigned long *sz);
 #else /* !CONFIG_KEXEC_CORE */
 struct pt_regs;
 struct task_struct;
@@ -541,6 +540,7 @@ void set_kexec_sig_enforced(void);
 static inline void set_kexec_sig_enforced(void) {}
 #endif
 
+
 #endif /* !defined(__ASSEBMLY__) */
 
 #endif /* LINUX_KEXEC_H */
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-07  8:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240105103305.557273-2-bhe@redhat.com>
2024-01-06 14:58 ` [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c kernel test robot
2024-01-07  8:52   ` Baoquan He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox