arch/x86/include/asm/cmpxchg_64.h:24:2: error: unknown type name 'u128'

From: kernel test robot
Date: Sun Jul 16 2023 - 15:07:01 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 831fe284d8275987596b7d640518dddba5735f61
commit: b23e139d0b66c0216e7e9361a5021290395f504c arch: Introduce arch_{,try_}_cmpxchg128{,_local}()
date: 6 weeks ago
config: i386-randconfig-r013-20230710 (https://download.01.org/0day-ci/archive/20230717/202307170214.X98DNEOs-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230717/202307170214.X98DNEOs-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307170214.X98DNEOs-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from scripts/mod/devicetable-offsets.c:3:
In file included from include/linux/mod_devicetable.h:14:
In file included from include/linux/uuid.h:11:
In file included from include/linux/string.h:20:
In file included from arch/x86/include/asm/string.h:5:
In file included from arch/x86/include/asm/string_64.h:6:
In file included from include/linux/jump_label.h:255:
In file included from include/linux/atomic.h:7:
In file included from arch/x86/include/asm/atomic.h:8:
In file included from arch/x86/include/asm/cmpxchg.h:145:
>> arch/x86/include/asm/cmpxchg_64.h:24:2: error: unknown type name 'u128'
u128 full;
^
arch/x86/include/asm/cmpxchg_64.h:44:24: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:44:54: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:44:65: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:44:75: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128(volatile u128 *ptr, u128 old, u128 new)
^
>> arch/x86/include/asm/cmpxchg_64.h:46:9: error: invalid output size for constraint '+a'
return __arch_cmpxchg128(ptr, old, new, LOCK_PREFIX);
^
arch/x86/include/asm/cmpxchg_64.h:37:16: note: expanded from macro '__arch_cmpxchg128'
"+a" (o.low), "+d" (o.high) \
^
arch/x86/include/asm/cmpxchg_64.h:49:24: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128_local(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:49:60: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128_local(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:49:71: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128_local(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:49:81: error: unknown type name 'u128'
static __always_inline u128 arch_cmpxchg128_local(volatile u128 *ptr, u128 old, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:51:9: error: invalid output size for constraint '+a'
return __arch_cmpxchg128(ptr, old, new,);
^
arch/x86/include/asm/cmpxchg_64.h:37:16: note: expanded from macro '__arch_cmpxchg128'
"+a" (o.low), "+d" (o.high) \
^
arch/x86/include/asm/cmpxchg_64.h:74:58: error: unknown type name 'u128'
static __always_inline bool arch_try_cmpxchg128(volatile u128 *ptr, u128 *oldp, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:74:69: error: unknown type name 'u128'
static __always_inline bool arch_try_cmpxchg128(volatile u128 *ptr, u128 *oldp, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:74:81: error: unknown type name 'u128'
static __always_inline bool arch_try_cmpxchg128(volatile u128 *ptr, u128 *oldp, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:76:9: error: invalid output size for constraint '+a'
return __arch_try_cmpxchg128(ptr, oldp, new, LOCK_PREFIX);
^
arch/x86/include/asm/cmpxchg_64.h:64:16: note: expanded from macro '__arch_try_cmpxchg128'
"+a" (o.low), "+d" (o.high) \
^
arch/x86/include/asm/cmpxchg_64.h:79:64: error: unknown type name 'u128'
static __always_inline bool arch_try_cmpxchg128_local(volatile u128 *ptr, u128 *oldp, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:79:75: error: unknown type name 'u128'
static __always_inline bool arch_try_cmpxchg128_local(volatile u128 *ptr, u128 *oldp, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:79:87: error: unknown type name 'u128'
static __always_inline bool arch_try_cmpxchg128_local(volatile u128 *ptr, u128 *oldp, u128 new)
^
arch/x86/include/asm/cmpxchg_64.h:81:9: error: invalid output size for constraint '+a'
return __arch_try_cmpxchg128(ptr, oldp, new,);
^
arch/x86/include/asm/cmpxchg_64.h:64:16: note: expanded from macro '__arch_try_cmpxchg128'
"+a" (o.low), "+d" (o.high) \
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [scripts/Makefile.build:114: scripts/mod/devicetable-offsets.s] Error 1
make[2]: Target 'scripts/mod/' not remade because of errors.
make[1]: *** [Makefile:1286: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +/u128 +24 arch/x86/include/asm/cmpxchg_64.h

22
23 union __u128_halves {
> 24 u128 full;
25 struct {
26 u64 low, high;
27 };
28 };
29
30 #define __arch_cmpxchg128(_ptr, _old, _new, _lock) \
31 ({ \
32 union __u128_halves o = { .full = (_old), }, \
33 n = { .full = (_new), }; \
34 \
35 asm volatile(_lock "cmpxchg16b %[ptr]" \
36 : [ptr] "+m" (*(_ptr)), \
37 "+a" (o.low), "+d" (o.high) \
38 : "b" (n.low), "c" (n.high) \
39 : "memory"); \
40 \
41 o.full; \
42 })
43
> 44 static __always_inline u128 arch_cmpxchg128(volatile u128 *ptr, u128 old, u128 new)
45 {
> 46 return __arch_cmpxchg128(ptr, old, new, LOCK_PREFIX);
47 }
48

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki