tree:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
head:   30df74d67d48949da87e3a5b57c381763e8fd526
commit: 140777a3d8dfdb3d3f20ea7707c0f1c0ce1b0aa5 [17/110] powerpc/fadump: 
consider reserved ranges while reserving memory
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 140777a3d8dfdb3d3f20ea7707c0f1c0ce1b0aa5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <l...@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

arch/powerpc/kernel/fadump.c:71:12: warning: no previous prototype for 
'fadump_cma_init' [-Wmissing-prototypes]
71 | int __init fadump_cma_init(void)
|            ^~~~~~~~~~~~~~~
arch/powerpc/kernel/fadump.c: In function 'fadump_reserve_mem':
>> arch/powerpc/kernel/fadump.c:513:18: warning: variable 'mem_boundary' set 
>> but not used [-Wunused-but-set-variable]
513 |  u64 base, size, mem_boundary, bootmem_min;
|                  ^~~~~~~~~~~~
arch/powerpc/kernel/fadump.c: In function 'fadump_update_elfcore_header':
arch/powerpc/kernel/fadump.c:731:17: warning: variable 'elf' set but not used 
[-Wunused-but-set-variable]
731 |  struct elfhdr *elf;
|                 ^~~

vim +/mem_boundary +513 arch/powerpc/kernel/fadump.c

   510  
   511  int __init fadump_reserve_mem(void)
   512  {
 > 513          u64 base, size, mem_boundary, bootmem_min;
   514          int ret = 1;
   515  
   516          if (!fw_dump.fadump_enabled)
   517                  return 0;
   518  
   519          if (!fw_dump.fadump_supported) {
   520                  pr_info("Firmware-Assisted Dump is not supported on 
this hardware\n");
   521                  goto error_out;
   522          }
   523  
   524          /*
   525           * Initialize boot memory size
   526           * If dump is active then we have already calculated the size 
during
   527           * first kernel.
   528           */
   529          if (!fw_dump.dump_active) {
   530                  fw_dump.boot_memory_size =
   531                          PAGE_ALIGN(fadump_calculate_reserve_size());
   532  #ifdef CONFIG_CMA
   533                  if (!fw_dump.nocma) {
   534                          fw_dump.boot_memory_size =
   535                                  ALIGN(fw_dump.boot_memory_size,
   536                                        FADUMP_CMA_ALIGNMENT);
   537                  }
   538  #endif
   539  
   540                  bootmem_min = fw_dump.ops->fadump_get_bootmem_min();
   541                  if (fw_dump.boot_memory_size < bootmem_min) {
   542                          pr_err("Can't enable fadump with boot memory 
size (0x%lx) less than 0x%llx\n",
   543                                 fw_dump.boot_memory_size, bootmem_min);
   544                          goto error_out;
   545                  }
   546  
   547                  if (!fadump_get_boot_mem_regions()) {
   548                          pr_err("Too many holes in boot memory area to 
enable fadump\n");
   549                          goto error_out;
   550                  }
   551          }
   552  
   553          /*
   554           * Calculate the memory boundary.
   555           * If memory_limit is less than actual memory boundary then 
reserve
   556           * the memory for fadump beyond the memory_limit and adjust the
   557           * memory_limit accordingly, so that the running kernel can run 
with
   558           * specified memory_limit.
   559           */
   560          if (memory_limit && memory_limit < memblock_end_of_DRAM()) {
   561                  size = get_fadump_area_size();
   562                  if ((memory_limit + size) < memblock_end_of_DRAM())
   563                          memory_limit += size;
   564                  else
   565                          memory_limit = memblock_end_of_DRAM();
   566                  printk(KERN_INFO "Adjusted memory_limit for 
firmware-assisted"
   567                                  " dump, now %#016llx\n", memory_limit);
   568          }
   569          if (memory_limit)
   570                  mem_boundary = memory_limit;
   571          else
   572                  mem_boundary = memblock_end_of_DRAM();
   573  
   574          base = fw_dump.boot_mem_top;
   575          size = get_fadump_area_size();
   576          fw_dump.reserve_dump_area_size = size;
   577          if (fw_dump.dump_active) {
   578                  pr_info("Firmware-assisted dump is active.\n");
   579  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

Reply via email to