Hi Mahesh,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v6.5-rc2 next-20230720]
[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/Mahesh-J-Salgaonkar/kdump-fix/20230720-021115
base:   linus/master
patch link:    
https://lore.kernel.org/r/2ogfzwjumrd44kxv7njfpot6fhtkzpqu77qv3bspfixdmsxcwc%40umt35y2hmslm
patch subject: [PATCH] kdump fix
config: x86_64-allyesconfig 
(https://download.01.org/0day-ci/archive/20230721/202307211100.udh0fq50-...@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: 
(https://download.01.org/0day-ci/archive/20230721/202307211100.udh0fq50-...@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 <l...@intel.com>
| Closes: 
https://lore.kernel.org/oe-kbuild-all/202307211100.udh0fq50-...@intel.com/

All errors (new ones prefixed by >>):

   kernel/kexec_file.c: In function 'crash_prepare_elf64_headers':
>> kernel/kexec_file.c:1282:25: error: 'ELF_CORE_EFLAGS' undeclared (first use 
>> in this function)
    1282 |         ehdr->e_flags = ELF_CORE_EFLAGS;
         |                         ^~~~~~~~~~~~~~~
   kernel/kexec_file.c:1282:25: note: each undeclared identifier is reported 
only once for each function it appears in


vim +/ELF_CORE_EFLAGS +1282 kernel/kexec_file.c

  1236  
  1237  int crash_prepare_elf64_headers(struct crash_mem *mem, int 
need_kernel_map,
  1238                            void **addr, unsigned long *sz)
  1239  {
  1240          Elf64_Ehdr *ehdr;
  1241          Elf64_Phdr *phdr;
  1242          unsigned long nr_cpus = num_possible_cpus(), nr_phdr, elf_sz;
  1243          unsigned char *buf;
  1244          unsigned int cpu, i;
  1245          unsigned long long notes_addr;
  1246          unsigned long mstart, mend;
  1247  
  1248          /* extra phdr for vmcoreinfo ELF note */
  1249          nr_phdr = nr_cpus + 1;
  1250          nr_phdr += mem->nr_ranges;
  1251  
  1252          /*
  1253           * kexec-tools creates an extra PT_LOAD phdr for kernel text 
mapping
  1254           * area (for example, ffffffff80000000 - ffffffffa0000000 on 
x86_64).
  1255           * I think this is required by tools like gdb. So same physical
  1256           * memory will be mapped in two ELF headers. One will contain 
kernel
  1257           * text virtual addresses and other will have __va(physical) 
addresses.
  1258           */
  1259  
  1260          nr_phdr++;
  1261          elf_sz = sizeof(Elf64_Ehdr) + nr_phdr * sizeof(Elf64_Phdr);
  1262          elf_sz = ALIGN(elf_sz, ELF_CORE_HEADER_ALIGN);
  1263  
  1264          buf = vzalloc(elf_sz);
  1265          if (!buf)
  1266                  return -ENOMEM;
  1267  
  1268          ehdr = (Elf64_Ehdr *)buf;
  1269          phdr = (Elf64_Phdr *)(ehdr + 1);
  1270          memcpy(ehdr->e_ident, ELFMAG, SELFMAG);
  1271          ehdr->e_ident[EI_CLASS] = ELFCLASS64;
  1272          ehdr->e_ident[EI_DATA] = ELFDATA2LSB;
  1273          ehdr->e_ident[EI_VERSION] = EV_CURRENT;
  1274          ehdr->e_ident[EI_OSABI] = ELF_OSABI;
  1275          memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD);
  1276          ehdr->e_type = ET_CORE;
  1277          ehdr->e_machine = ELF_ARCH;
  1278          ehdr->e_version = EV_CURRENT;
  1279          ehdr->e_phoff = sizeof(Elf64_Ehdr);
  1280          ehdr->e_ehsize = sizeof(Elf64_Ehdr);
  1281          ehdr->e_phentsize = sizeof(Elf64_Phdr);
> 1282          ehdr->e_flags = ELF_CORE_EFLAGS;

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

Reply via email to