Files
linux/arch/x86/include/asm
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
..
2021-10-20 22:35:04 +02:00
2024-01-03 11:46:22 +01:00
2022-08-04 11:11:59 +02:00
2024-01-03 11:46:22 +01:00
2023-11-21 17:23:35 +01:00
2023-12-15 16:25:55 -08:00
2024-04-08 19:27:06 +02:00
2024-02-15 22:07:36 +01:00
2020-05-07 16:06:20 +02:00
2024-02-27 00:23:55 +01:00
2021-12-11 09:09:47 +01:00
2021-10-28 23:25:26 +02:00
2020-10-28 20:26:25 +01:00
2020-11-26 12:58:56 +01:00
2020-11-06 23:14:58 +01:00
2024-01-03 11:46:22 +01:00
2023-10-03 10:38:08 +02:00
2022-04-07 08:27:52 -07:00
2022-11-10 13:12:45 +01:00
2023-06-01 15:04:33 +02:00
2023-08-02 15:01:51 -07:00
2021-12-11 09:09:45 +01:00
2024-02-27 12:22:43 -08:00
2022-01-30 21:17:00 -05:00
2022-01-30 21:17:00 -05:00