]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/locking: Remove semicolon from "lock" prefix
authorUros Bizjak <ubizjak@gmail.com>
Fri, 28 Feb 2025 08:51:15 +0000 (09:51 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 28 Feb 2025 09:18:26 +0000 (10:18 +0100)
commit023f3290b02552ea006c1a2013e373750d2cbff6
tree9a9ddea4298f7f4a2837cf57d439aa5695103346
parent337369f8ce9e20226402cf139c4f0d3ada7d1705
x86/locking: Remove semicolon from "lock" prefix

Minimum version of binutils required to compile the kernel is 2.25.
This version correctly handles the "lock" prefix, so it is possible
to remove the semicolon, which was used to support ancient versions
of GNU as.

Due to the semicolon, the compiler considers "lock; insn" as two
separate instructions. Removing the semicolon makes asm length
calculations more accurate, consequently making scheduling and
inlining decisions of the compiler more accurate.

Removing the semicolon also enables assembler checks involving lock
prefix. Trying to assemble e.g. "lock andl %eax, %ebx" results in:

  Error: expecting lockable instruction after `lock'

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250228085149.2478245-1-ubizjak@gmail.com
arch/x86/include/asm/alternative.h
arch/x86/include/asm/barrier.h
arch/x86/include/asm/cmpxchg.h
arch/x86/include/asm/cmpxchg_32.h
arch/x86/include/asm/edac.h
arch/x86/include/asm/sync_bitops.h