]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/bug: Fix old GCC compile fails
authorPeter Zijlstra <peterz@infradead.org>
Thu, 18 Dec 2025 10:47:38 +0000 (11:47 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 18 Dec 2025 10:55:40 +0000 (11:55 +0100)
For some mysterious reasons the GCC 8 and 9 preprocessor manages to
sporadically fumble _ASM_BYTES(0x0f, 0x0b):

$ grep ".byte[ ]*0x0f" defconfig-build/drivers/net/wireless/realtek/rtlwifi/base.s
        1:       .byte0x0f,0x0b ;
        1:       .byte 0x0f,0x0b ;

which makes the assembler upset and all that. While there are more
_ASM_BYTES() users (notably the NOP instructions), those don't seem
affected. Therefore replace the offending ASM_UD2 with one using the
ud2 mnemonic.

Reported-by: Jean Delvare <jdelvare@suse.de>
Suggested-by: Uros Bizjak <ubizjak@gmail.com>
Fixes: 85a2d4a890dc ("x86,ibt: Use UDB instead of 0xEA")
Cc: stable@kernel.org
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251218104659.GT3911114@noisy.programming.kicks-ass.net
arch/x86/include/asm/bug.h

index ee23b98353d735fd09a161ee217719d357b2c4af..40de5796adb52b49c21f0222f96dfb4e6d34f1a2 100644 (file)
@@ -15,7 +15,7 @@ extern void __WARN_trap(struct bug_entry *bug, ...);
 /*
  * Despite that some emulators terminate on UD2, we use it for WARN().
  */
-#define ASM_UD2                _ASM_BYTES(0x0f, 0x0b)
+#define ASM_UD2                __ASM_FORM(ud2)
 #define INSN_UD2       0x0b0f
 #define LEN_UD2                2