tree:
https://github.com/weiny2/linux-kernel.git tip-pks-v4.6-5.12-rc
head: 0a042414603935649c022b18cc1fdef0e7f2d3f3
commit: 25071b452a26dedd517b374ed5baf42970361e0a [25/32] <WARN SUP_PKEYS change>:
kmap: Add stray access protection for device pages
config: x86_64-randconfig-m001-20210316 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
#
https://github.com/weiny2/linux-kernel/commit/25071b452a26dedd517b374ed5b...
git remote add weiny2
https://github.com/weiny2/linux-kernel.git
git fetch --no-tags weiny2 tip-pks-v4.6-5.12-rc
git checkout 25071b452a26dedd517b374ed5baf42970361e0a
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> arch/x86/mm/fault.c:1220:6: error: redefinition of
'handle_pks'
1220 | bool handle_pks(struct pt_regs *regs, unsigned long
error_code,
| ^~~~~~~~~~
In file included from arch/x86/include/asm/cpufeature.h:5,
from arch/x86/include/asm/thread_info.h:53,
from include/linux/thread_info.h:58,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from arch/x86/mm/fault.c:7:
arch/x86/include/asm/processor.h:898:20: note: previous definition of
'handle_pks' was here
898 | static inline bool handle_pks(struct pt_regs *regs, unsigned long error_code,
| ^~~~~~~~~~
arch/x86/mm/fault.c: In function 'handle_pks':
arch/x86/mm/fault.c:1241:14: error: implicit declaration of function
'extended_pt_regs' [-Werror=implicit-function-declaration]
1241 | ept_regs = extended_pt_regs(regs);
| ^~~~~~~~~~~~~~~~
arch/x86/mm/fault.c:1241:12: warning: assignment to 'struct extended_pt_regs *'
from 'int' makes pointer from integer without a cast [-Wint-conversion]
1241 | ept_regs = extended_pt_regs(regs);
| ^
arch/x86/mm/fault.c:1242:27: error: dereferencing pointer to incomplete type
'struct extended_pt_regs'
1242 | update_pkey_val(ept_regs->thread_pkrs, pkey, 0);
| ^~
cc1: some warnings being treated as errors
vim +/handle_pks +1220 arch/x86/mm/fault.c
1218
1219 #ifdef CONFIG_ARCH_HAS_SUPERVISOR_PKEYS
1220 bool handle_pks(struct pt_regs *regs, unsigned long error_code,
1221 unsigned long address)
1222 {
1223 if (error_code & X86_PF_PK) {
1224 struct extended_pt_regs *ept_regs;
1225 struct page *page;
1226 int pkey;
1227
1228 page = virt_to_page(address);
1229
1230 if (!page || !page_is_globally_mapped(page))
1231 return false;
1232
1233 if (pks_mode == PKS_MODE_STRICT)
1234 return false;
1235
1236 WARN_ONCE(pks_mode == PKS_MODE_RELAXED,
1237 "PKS fault on globally mapped device page 0x%lu pfn %lu",
1238 address, page_to_pfn(page));
1239
1240 pkey = dev_get_dev_pkey();
1241 ept_regs = extended_pt_regs(regs);
1242 update_pkey_val(ept_regs->thread_pkrs, pkey, 0);
1243 return true;
1244 }
1245
1246 return false;
1247 }
1248 #endif
1249
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org