[alibaba-cloud:linux-next 10926/12249] net/hookers/hookers.c:281:14: warning: variable 'pudd' set but not used
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/DP3VC6U37LJ2QKP6JAIMVX7NVEZCU3Q2/
Hi Zou,
First bad commit (maybe != root cause):
tree: https://github.com/alibaba/cloud-kernel.git linux-next
head: c3ac3c331d6cc495be9603404799c061d71af44c
commit: db153a10baa44eb31fce8c5459dfef6722f34e56 [10926/12249] alinux: hookers: add arm64 dependency
config: arm64-randconfig-r031-20200928 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/alibaba/cloud-kernel/commit/db153a10baa44eb31fce8c5459dfef6722f34e56
git remote add alibaba-cloud https://github.com/alibaba/cloud-kernel.git
git fetch --no-tags alibaba-cloud linux-next
git checkout db153a10baa44eb31fce8c5459dfef6722f34e56
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
net/hookers/hookers.c: In function 'remove_memprotect':
>> net/hookers/hookers.c:281:14: warning: variable 'pudd' set but not used [-Wunused-but-set-variable]
281 | pud_t *pud, pudd;
| ^~~~
>> net/hookers/hookers.c:280:14: warning: variable 'pgdd' set but not used [-Wunused-but-set-variable]
280 | pgd_t *pgd, pgdd;
| ^~~~
net/hookers/hookers.c: In function 'set_memprotect':
net/hookers/hookers.c:303:14: warning: variable 'pudd' set but not used [-Wunused-but-set-variable]
303 | pud_t *pud, pudd;
| ^~~~
net/hookers/hookers.c:302:14: warning: variable 'pgdd' set but not used [-Wunused-but-set-variable]
302 | pgd_t *pgd, pgdd;
| ^~~~
vim +/pudd +281 net/hookers/hookers.c
bc56b7b3e8d79e Zou Cao 2019-12-01 277
bc56b7b3e8d79e Zou Cao 2019-12-01 278 static void remove_memprotect(unsigned long addr)
bc56b7b3e8d79e Zou Cao 2019-12-01 279 {
bc56b7b3e8d79e Zou Cao 2019-12-01 @280 pgd_t *pgd, pgdd;
bc56b7b3e8d79e Zou Cao 2019-12-01 @281 pud_t *pud, pudd;
bc56b7b3e8d79e Zou Cao 2019-12-01 282 pmd_t *pmd, pmdd;
bc56b7b3e8d79e Zou Cao 2019-12-01 283 u64 addr_aligned;
bc56b7b3e8d79e Zou Cao 2019-12-01 284
bc56b7b3e8d79e Zou Cao 2019-12-01 285 addr_aligned = addr & PAGE_MASK;
bc56b7b3e8d79e Zou Cao 2019-12-01 286
bc56b7b3e8d79e Zou Cao 2019-12-01 287 pgd = pgd_offset(orig_init_mm, (unsigned long)addr_aligned);
bc56b7b3e8d79e Zou Cao 2019-12-01 288 pgdd = READ_ONCE(*pgd);
bc56b7b3e8d79e Zou Cao 2019-12-01 289
bc56b7b3e8d79e Zou Cao 2019-12-01 290 pud = pud_offset(pgd, (unsigned long)addr_aligned);
bc56b7b3e8d79e Zou Cao 2019-12-01 291 pudd = READ_ONCE(*pud);
bc56b7b3e8d79e Zou Cao 2019-12-01 292
bc56b7b3e8d79e Zou Cao 2019-12-01 293 pmd = pmd_offset(pud, (unsigned long)addr_aligned);
bc56b7b3e8d79e Zou Cao 2019-12-01 294 pmdd = READ_ONCE(*pmd);
bc56b7b3e8d79e Zou Cao 2019-12-01 295
bc56b7b3e8d79e Zou Cao 2019-12-01 296 set_pmd(pmd, __pmd(pmd_val(pmdd) & ~PMD_SECT_RDONLY));
bc56b7b3e8d79e Zou Cao 2019-12-01 297 flush_tlb_kernel_range(addr_aligned, addr_aligned + PAGE_SIZE);
bc56b7b3e8d79e Zou Cao 2019-12-01 298 }
bc56b7b3e8d79e Zou Cao 2019-12-01 299
:::::: The code at line 281 was first introduced by commit
:::::: bc56b7b3e8d79e0d75ed0d19e7e128093f355b18 alinux: Hookers: add arm64 support
:::::: TO: Zou Cao <zoucao@linux.alibaba.com>
:::::: CC: Shile Zhang <shile.zhang@linux.alibaba.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org