CC: [email protected]
CC: [email protected]
TO: Alex Sverdlin <[email protected]>
CC: "Russell King (Oracle)" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   8ab774587903771821b59471cc723bba6d893942
commit: 79f32b221b18c15a98507b101ef4beb52444cc6f ARM: 9079/1: ftrace: Add 
MODULE_PLTS support
date:   5 months ago
:::::: branch date: 25 hours ago
:::::: commit date: 5 months ago
config: arm-randconfig-m031-20211104 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
arch/arm/kernel/module-plts.c:65 get_module_plt() warn: we never enter this loop

vim +65 arch/arm/kernel/module-plts.c

79f32b221b18c15 Alex Sverdlin  2021-05-05   50  
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   51  u32 get_module_plt(struct 
module *mod, unsigned long loc, Elf32_Addr val)
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   52  {
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   53          struct mod_plt_sec 
*pltsec = !in_init(mod, loc) ? &mod->arch.core :
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   54                                  
                          &mod->arch.init;
79f32b221b18c15 Alex Sverdlin  2021-05-05   55          struct plt_entries *plt;
79f32b221b18c15 Alex Sverdlin  2021-05-05   56          int idx;
79f32b221b18c15 Alex Sverdlin  2021-05-05   57  
79f32b221b18c15 Alex Sverdlin  2021-05-05   58          /* cache the address, 
ELF header is available only during module load */
79f32b221b18c15 Alex Sverdlin  2021-05-05   59          if (!pltsec->plt_ent)
79f32b221b18c15 Alex Sverdlin  2021-05-05   60                  pltsec->plt_ent 
= (struct plt_entries *)pltsec->plt->sh_addr;
79f32b221b18c15 Alex Sverdlin  2021-05-05   61          plt = pltsec->plt_ent;
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   62  
79f32b221b18c15 Alex Sverdlin  2021-05-05   63          prealloc_fixed(pltsec, 
plt);
79f32b221b18c15 Alex Sverdlin  2021-05-05   64  
79f32b221b18c15 Alex Sverdlin  2021-05-05  @65          for (idx = 0; idx < 
ARRAY_SIZE(fixed_plts); ++idx)
79f32b221b18c15 Alex Sverdlin  2021-05-05   66                  if 
(plt->lit[idx] == val)
79f32b221b18c15 Alex Sverdlin  2021-05-05   67                          return 
(u32)&plt->ldr[idx];
35fa91eed817d2c Ard Biesheuvel 2016-08-16   68  
79f32b221b18c15 Alex Sverdlin  2021-05-05   69          idx = 0;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   70          /*
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   71           * Look for an existing 
entry pointing to 'val'. Given that the
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   72           * relocations are 
sorted, this will be the last entry we allocated.
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   73           * (if one exists).
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   74           */
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   75          if (pltsec->plt_count > 
0) {
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   76                  plt += 
(pltsec->plt_count - 1) / PLT_ENT_COUNT;
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   77                  idx = 
(pltsec->plt_count - 1) % PLT_ENT_COUNT;
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   78  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   79                  if 
(plt->lit[idx] == val)
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   80                          return 
(u32)&plt->ldr[idx];
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   81  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   82                  idx = (idx + 1) 
% PLT_ENT_COUNT;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   83                  if (!idx)
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   84                          plt++;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   85          }
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   86  
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   87          pltsec->plt_count++;
b7ede5a1f5905ac Ard Biesheuvel 2017-02-22   88          
BUG_ON(pltsec->plt_count * PLT_ENT_SIZE > pltsec->plt->sh_size);
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   89  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   90          if (!idx)
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   91                  /* Populate a 
new set of entries */
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   92                  *plt = (struct 
plt_entries){
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   93                          { [0 
... PLT_ENT_COUNT - 1] = PLT_ENT_LDR, },
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   94                          { val, }
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24   95                  };
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   96          else
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   97                  plt->lit[idx] = 
val;
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   98  
66e94ba3c8ea5ff Ard Biesheuvel 2016-08-18   99          return 
(u32)&plt->ldr[idx];
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24  100  }
7d485f647c1f4a6 Ard Biesheuvel 2014-11-24  101  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to