Re: [PATCH v2 1/9] riscv: add ARCH_HAS_SET_MEMORY support

From: kbuild test robot
Date: Mon Mar 09 2020 - 08:50:54 EST


Hi Zong,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.6-rc5]
[also build test ERROR on next-20200306]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Zong-Li/Support-strict-kernel-memory-permissions-for-security/20200309-172554
base: 2c523b344dfa65a3738e7039832044aa133c75fb
config: riscv-nommu_virt_defconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=riscv

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

arch/riscv/mm/pageattr.c: In function 'pageattr_pmd_entry':
>> arch/riscv/mm/pageattr.c:73:3: error: implicit declaration of function 'set_pmd'; did you mean 'set_pud'? [-Werror=implicit-function-declaration]
set_pmd(pmd, val);
^~~~~~~
set_pud
arch/riscv/mm/pageattr.c: In function 'pageattr_pte_entry':
>> arch/riscv/mm/pageattr.c:85:2: error: implicit declaration of function 'set_pte'; did you mean 'set_pud'? [-Werror=implicit-function-declaration]
set_pte(pte, val);
^~~~~~~
set_pud
cc1: some warnings being treated as errors

vim +73 arch/riscv/mm/pageattr.c

65
66 static int pageattr_pmd_entry(pmd_t *pmd, unsigned long addr,
67 unsigned long next, struct mm_walk *walk)
68 {
69 pmd_t val = READ_ONCE(*pmd);
70
71 if (pmd_leaf(val)) {
72 val = __pmd(set_pageattr_masks(pmd_val(val), walk));
> 73 set_pmd(pmd, val);
74 }
75
76 return 0;
77 }
78
79 static int pageattr_pte_entry(pte_t *pte, unsigned long addr,
80 unsigned long next, struct mm_walk *walk)
81 {
82 pte_t val = READ_ONCE(*pte);
83
84 val = __pte(set_pageattr_masks(pte_val(val), walk));
> 85 set_pte(pte, val);
86
87 return 0;
88 }
89

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

Attachment: .config.gz
Description: application/gzip