tree:
https://github.com/intel/linux-intel-lts.git 5.10/yocto
head: 2202f30edc3f9f14646647cd48c4bd4bfd12e9b7
commit: a18c5b9b95c27d092a997152c4e640dd6c235b82 [17552/17586] x86/mm: Update
ptep_set_wrprotect() and pmdp_set_wrprotect() for transition from _PAGE_DIRTY to
_PAGE_COW
config: i386-randconfig-a013-20211115 (attached as .config)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
fbe72e41b99dc7994daac300d208a955be3e4a0a)
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/intel/linux-intel-lts/commit/a18c5b9b95c27d092a997152c...
git remote add intel-lts
https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-lts 5.10/yocto
git checkout a18c5b9b95c27d092a997152c4e640dd6c235b82
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir
ARCH=i386 prepare
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 >>):
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
> arch/x86/include/asm/pgtable.h:1323:13: error: invalid output
size for constraint '+a'
} while
(!try_cmpxchg(&ptep->pte, &old_pte.pte, new_pte.pte));
^
arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:172:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
> arch/x86/include/asm/pgtable.h:1323:13: error: invalid output
size for constraint '+a'
arch/x86/include/asm/cmpxchg.h:225:2: note:
expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:184:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
> arch/x86/include/asm/pgtable.h:1323:13: error: invalid output
size for constraint '+a'
arch/x86/include/asm/cmpxchg.h:225:2: note:
expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:196:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
> arch/x86/include/asm/pgtable.h:1323:13: error: invalid output
size for constraint '+a'
arch/x86/include/asm/cmpxchg.h:225:2: note:
expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:208:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
arch/x86/include/asm/pgtable.h:1385:13: error: invalid output size for constraint
'+a'
} while (!try_cmpxchg((pmdval_t *)pmdp, (pmdval_t *)&old_pmd,
pmd_val(new_pmd)));
^
arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:172:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
arch/x86/include/asm/pgtable.h:1385:13: error: invalid output size for constraint
'+a'
arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:184:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
arch/x86/include/asm/pgtable.h:1385:13: error: invalid output size for constraint
'+a'
arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:196:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
In file included from arch/x86/kernel/asm-offsets.c:13:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:13:
In file included from include/linux/cgroup.h:28:
In file included from include/linux/cgroup-defs.h:22:
In file included from include/linux/bpf-cgroup.h:5:
In file included from include/linux/bpf.h:21:
In file included from include/linux/kallsyms.h:12:
In file included from include/linux/mm.h:33:
In file included from include/linux/pgtable.h:6:
arch/x86/include/asm/pgtable.h:1385:13: error: invalid output size for constraint
'+a'
arch/x86/include/asm/cmpxchg.h:225:2: note: expanded from macro 'try_cmpxchg'
__try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
^
arch/x86/include/asm/cmpxchg.h:222:2: note: expanded from macro
'__try_cmpxchg'
__raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
^
arch/x86/include/asm/cmpxchg.h:208:23: note: expanded from macro
'__raw_try_cmpxchg'
[old] "+a" (__old) \
^
8 errors generated.
make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1215: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
vim +1323 arch/x86/include/asm/pgtable.h
1304
1305 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
1306 static inline void ptep_set_wrprotect(struct mm_struct *mm,
1307 unsigned long addr, pte_t *ptep)
1308 {
1309 /*
1310 * If Shadow Stack is enabled, pte_wrprotect() moves _PAGE_DIRTY
1311 * to _PAGE_COW (see comments at pte_wrprotect()).
1312 * When a thread reads a RW=1, Dirty=0 PTE and before changing it
1313 * to RW=0, Dirty=0, another thread could have written to the page
1314 * and the PTE is RW=1, Dirty=1 now. Use try_cmpxchg() to detect
1315 * PTE changes and update old_pte, then try again.
1316 */
1317 if (cpu_feature_enabled(X86_FEATURE_SHSTK)) {
1318 pte_t old_pte, new_pte;
1319
1320 old_pte = READ_ONCE(*ptep);
1321 do {
1322 new_pte = pte_wrprotect(old_pte);
1323 } while (!try_cmpxchg(&ptep->pte, &old_pte.pte,
new_pte.pte));
1324
1325 return;
1326 }
1327 clear_bit(_PAGE_BIT_RW, (unsigned long *)&ptep->pte);
1328 }
1329
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org