Hi Yu-cheng,
FYI, the error/warning still remains.
tree:
https://github.com/changbae/Linux-kernel adl-po-presilicon
head: 6173b90dca1633db3ad2ddb01b0825969c0aa8e3
commit: 80099214d3f4c0f2773d9b7fd12d08ca6abda03a [6119/9999] x86/mm: Update
ptep_set_wrprotect() and pmdp_set_wrprotect() for transition from _PAGE_DIRTY_HW to
_PAGE_COW
config: i386-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
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 include/linux/mm.h:95,
from include/linux/kallsyms.h:12,
from include/linux/bpf.h:21,
from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
arch/x86/include/asm/pgtable.h: In function 'pte_wrprotect':
arch/x86/include/asm/pgtable.h:359:26: warning: left shift count >= width of type
[-Wshift-count-overflow]
359 | _PAGE_BIT_DIRTY_HW << _PAGE_BIT_COW;
| ^~
arch/x86/include/asm/pgtable.h: In function 'pmd_wrprotect':
arch/x86/include/asm/pgtable.h:485:7: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
485 | pmd.pmd |= (pmd.pmd & _PAGE_DIRTY_HW) >>
| ^~~
| pud
arch/x86/include/asm/pgtable.h:485:19: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
485 | pmd.pmd |= (pmd.pmd & _PAGE_DIRTY_HW) >>
| ^~~
| pud
arch/x86/include/asm/pgtable.h: In function 'pud_wrprotect':
arch/x86/include/asm/pgtable.h:570:7: error: 'pud_t' {aka 'struct
<anonymous>'} has no member named 'pud'; did you mean 'p4d'?
570 | pud.pud |= (pud.pud & _PAGE_DIRTY_HW) >>
| ^~~
| p4d
arch/x86/include/asm/pgtable.h:570:19: error: 'pud_t' {aka 'struct
<anonymous>'} has no member named 'pud'; did you mean 'p4d'?
570 | pud.pud |= (pud.pud & _PAGE_DIRTY_HW) >>
| ^~~
| p4d
In file included from arch/x86/include/asm/atomic.h:8,
from include/linux/atomic.h:7,
from include/linux/crypto.h:15,
from arch/x86/kernel/asm-offsets.c:9:
arch/x86/include/asm/pgtable.h: In function 'pmdp_set_wrprotect':
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:161:13: note: in definition of macro
'__raw_try_cmpxchg'
161 | __typeof__(_ptr) _old = (__typeof__(_ptr))(_pold); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:161:38: note: in definition of macro
'__raw_try_cmpxchg'
161 | __typeof__(_ptr) _old = (__typeof__(_ptr))(_pold); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:46: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:161:45: note: in definition of macro
'__raw_try_cmpxchg'
161 | __typeof__(_ptr) _old = (__typeof__(_ptr))(_pold); \
| ^~~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:162:15: note: in definition of macro
'__raw_try_cmpxchg'
162 | __typeof__(*(_ptr)) __old = *_old; \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
> arch/x86/include/asm/cmpxchg.h:162:30: error: invalid type
argument of unary '*' (have 'int')
162 | __typeof__(*(_ptr))
__old = *_old; \
| ^~~~~
arch/x86/include/asm/cmpxchg.h:222:2: note: in expansion of macro
'__raw_try_cmpxchg'
222 | __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
| ^~~~~~~~~~~~~~~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:163:15: note: in definition of macro
'__raw_try_cmpxchg'
163 | __typeof__(*(_ptr)) __new = (_new); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:59: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:163:31: note: in definition of macro
'__raw_try_cmpxchg'
163 | __typeof__(*(_ptr)) __new = (_new); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:164:10: note: in definition of macro
'__raw_try_cmpxchg'
164 | switch (size) { \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:167:40: note: in definition of macro
'__raw_try_cmpxchg'
167 | volatile u8 *__ptr = (volatile u8 *)(_ptr); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:179:42: note: in definition of macro
'__raw_try_cmpxchg'
179 | volatile u16 *__ptr = (volatile u16 *)(_ptr); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:191:42: note: in definition of macro
'__raw_try_cmpxchg'
191 | volatile u32 *__ptr = (volatile u32 *)(_ptr); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:32: error: 'pmd_t' {aka 'struct
<anonymous>'} has no member named 'pmd'; did you mean 'pud'?
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~
arch/x86/include/asm/cmpxchg.h:203:42: note: in definition of macro
'__raw_try_cmpxchg'
203 | volatile u64 *__ptr = (volatile u64 *)(_ptr); \
| ^~~~
arch/x86/include/asm/cmpxchg.h:225:2: note: in expansion of macro
'__try_cmpxchg'
225 | __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr)))
| ^~~~~~~~~~~~~
arch/x86/include/asm/pgtable.h:1421:13: note: in expansion of macro
'try_cmpxchg'
1421 | } while (!try_cmpxchg(&pmdp->pmd, &old_pmd.pmd, new_pmd.pmd));
| ^~~~~~~~~~~
arch/x86/include/asm/cmpxchg.h:217:3: error: invalid type argument of unary '*'
(have 'int')
217 | *_old = __old; \
| ^~~~~
arch/x86/include/asm/cmpxchg.h:222:2: note: in expansion of macro
'__raw_try_cmpxchg'
222 | __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX)
vim +162 arch/x86/include/asm/cmpxchg.h
e9826380d83d1b Jeremy Fitzhardinge 2011-08-18 147
8bf705d130396e Dmitry Vyukov 2018-01-29 148 #define arch_cmpxchg(ptr, old,
new) \
fc395b9291925b Jan Beulich 2012-01-26 149 __cmpxchg(ptr, old, new,
sizeof(*(ptr)))
e9826380d83d1b Jeremy Fitzhardinge 2011-08-18 150
8bf705d130396e Dmitry Vyukov 2018-01-29 151 #define arch_sync_cmpxchg(ptr, old,
new) \
fc395b9291925b Jan Beulich 2012-01-26 152 __sync_cmpxchg(ptr, old, new,
sizeof(*(ptr)))
e9826380d83d1b Jeremy Fitzhardinge 2011-08-18 153
8bf705d130396e Dmitry Vyukov 2018-01-29 154 #define arch_cmpxchg_local(ptr, old,
new) \
fc395b9291925b Jan Beulich 2012-01-26 155 __cmpxchg_local(ptr, old, new,
sizeof(*(ptr)))
e9826380d83d1b Jeremy Fitzhardinge 2011-08-18 156
a9ebf306f52c75 Peter Zijlstra 2017-02-01 157
a9ebf306f52c75 Peter Zijlstra 2017-02-01 158 #define __raw_try_cmpxchg(_ptr, _pold,
_new, size, lock) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 159 ({ \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 160 bool success; \
007d185b44620f Dmitry Vyukov 2017-06-17 161 __typeof__(_ptr) _old =
(__typeof__(_ptr))(_pold); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 @162 __typeof__(*(_ptr)) __old =
*_old; \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 163 __typeof__(*(_ptr)) __new =
(_new); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 164 switch (size) { \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 165 case __X86_CASE_B: \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 166 { \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 167 volatile u8 *__ptr = (volatile u8
*)(_ptr); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 168 asm volatile(lock "cmpxchgb
%[new], %[ptr]" \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 169 CC_SET(z) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 170 : CC_OUT(z) (success), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 171 [ptr] "+m"
(*__ptr), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 172 [old] "+a"
(__old) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 173 : [new] "q"
(__new) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 174 : "memory"); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 175 break; \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 176 } \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 177 case __X86_CASE_W: \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 178 { \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 179 volatile u16 *__ptr = (volatile u16
*)(_ptr); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 180 asm volatile(lock "cmpxchgw
%[new], %[ptr]" \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 181 CC_SET(z) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 182 : CC_OUT(z) (success), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 183 [ptr] "+m"
(*__ptr), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 184 [old] "+a"
(__old) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 185 : [new] "r"
(__new) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 186 : "memory"); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 187 break; \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 188 } \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 189 case __X86_CASE_L: \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 190 { \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 191 volatile u32 *__ptr = (volatile u32
*)(_ptr); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 192 asm volatile(lock "cmpxchgl
%[new], %[ptr]" \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 193 CC_SET(z) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 194 : CC_OUT(z) (success), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 195 [ptr] "+m"
(*__ptr), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 196 [old] "+a"
(__old) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 197 : [new] "r"
(__new) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 198 : "memory"); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 199 break; \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 200 } \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 201 case __X86_CASE_Q: \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 202 { \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 203 volatile u64 *__ptr = (volatile u64
*)(_ptr); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 204 asm volatile(lock "cmpxchgq
%[new], %[ptr]" \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 205 CC_SET(z) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 206 : CC_OUT(z) (success), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 207 [ptr] "+m"
(*__ptr), \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 208 [old] "+a"
(__old) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 209 : [new] "r"
(__new) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 210 : "memory"); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 211 break; \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 212 } \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 213 default: \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 214 __cmpxchg_wrong_size(); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 215 } \
44fe84459faf1a Peter Zijlstra 2017-03-27 216 if (unlikely(!success)) \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 217 *_old = __old; \
44fe84459faf1a Peter Zijlstra 2017-03-27 218 likely(success); \
a9ebf306f52c75 Peter Zijlstra 2017-02-01 219 })
a9ebf306f52c75 Peter Zijlstra 2017-02-01 220
:::::: The code at line 162 was first introduced by commit
:::::: a9ebf306f52c756c4f9e50ee9a60cd6389d71344 locking/atomic: Introduce
atomic_try_cmpxchg()
:::::: TO: Peter Zijlstra <peterz(a)infradead.org>
:::::: CC: Ingo Molnar <mingo(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org