]> www.infradead.org Git - linux.git/commit
x86/boot: Remove semicolon from "rep" prefixes
authorUros Bizjak <ubizjak@gmail.com>
Fri, 18 Apr 2025 07:13:50 +0000 (09:13 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 18 Apr 2025 07:32:57 +0000 (09:32 +0200)
commit0dcc51477b94d87f23aeb400b78fbdfb09363000
tree8df0f505cf38620456b8ad2991e44d1729301c7f
parent498cb872a111e25021ca5e2d91af7b7a2e62630f
x86/boot: Remove semicolon from "rep" prefixes

Minimum version of binutils required to compile the kernel is 2.25.
This version correctly handles the "rep" prefixes, 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 "rep; insn" (or its
alternate "rep\n\tinsn" form) 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 "rep"
prefixes. Trying to assemble e.g. "rep addl %eax, %ebx" results in:

  Error: invalid instruction `add' after `rep'

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Mares <mj@ucw.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250418071437.4144391-1-ubizjak@gmail.com
arch/x86/boot/bioscall.S
arch/x86/boot/boot.h
arch/x86/boot/compressed/string.c
arch/x86/boot/copy.S
arch/x86/boot/header.S
arch/x86/boot/string.c
arch/x86/boot/video.c