linux/arch
Linus Torvalds 769327258a x86-32: fix cmpxchg8b_emu build error with clang
The kernel test robot reported that clang no longer compiles the 32-bit
x86 kernel in some configurations due to commit 95ece48165
("locking/atomic/x86: Rewrite x86_32 arch_atomic64_{,fetch}_{and,or,xor}()
functions").

The build fails with

  arch/x86/include/asm/cmpxchg_32.h:149:9: error: inline assembly requires more registers than available

and the reason seems to be that not only does the cmpxchg8b instruction
need four fixed registers (EDX:EAX and ECX:EBX), with the emulation
fallback the inline asm also wants a fifth fixed register for the
address (it uses %esi for that, but that's just a software convention
with cmpxchg8b_emu).

Avoiding using another pointer input to the asm (and just forcing it to
use the "0(%esi)" addressing that we end up requiring for the sw
fallback) seems to fix the issue.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406230912.F6XFIyA6-lkp@intel.com/
Fixes: 95ece48165 ("locking/atomic/x86: Rewrite x86_32 arch_atomic64_{,fetch}_{and,or,xor}() functions")
Link: https://lore.kernel.org/all/202406230912.F6XFIyA6-lkp@intel.com/
Suggested-by: Uros Bizjak <ubizjak@gmail.com>
Reviewed-and-Tested-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-06-30 09:21:29 -07:00
..
alpha mseal: wire up mseal syscall 2024-05-23 19:40:26 -07:00
arc bpf-for-netdev 2024-05-27 16:26:30 -07:00
arm SoC fixes for 6.10 2024-06-22 07:58:21 -07:00
arm64 hardening fixes for v6.10-rc6 2024-06-28 16:11:02 -07:00
csky syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
hexagon hexagon: fix fadvise64_64 calling conventions 2024-06-25 15:57:37 +02:00
loongarch syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
m68k mseal: wire up mseal syscall 2024-05-23 19:40:26 -07:00
microblaze syscalls: mmap(): use unsigned offset type consistently 2024-06-25 15:57:38 +02:00
mips syscalls: fix compat_sys_io_pgetevents_time64 usage 2024-06-25 15:57:20 +02:00
nios2 Kbuild updates for v6.10 2024-05-18 12:39:20 -07:00
openrisc openrisc: Move FPU state out of pt_regs 2024-04-15 15:20:39 +01:00
parisc parisc: use generic sys_fanotify_mark implementation 2024-06-25 15:57:25 +02:00
powerpc powerpc: restore some missing spu syscalls 2024-06-25 15:57:26 +02:00
riscv RISC-V Fixes for 6.10-rc6 2024-06-28 16:14:59 -07:00
s390 hardening fixes for v6.10-rc6 2024-06-28 16:11:02 -07:00
sh sh: rework sync_file_range ABI 2024-06-25 15:57:26 +02:00
sparc sparc: fix compat recv/recvfrom syscalls 2024-06-25 15:57:25 +02:00
um This pull request contains the following changes for UML: 2024-05-25 13:17:48 -07:00
x86 x86-32: fix cmpxchg8b_emu build error with clang 2024-06-30 09:21:29 -07:00
xtensa mseal: wire up mseal syscall 2024-05-23 19:40:26 -07:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-17 12:57:03 -07:00