Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86-32: Fix boot with CONFIG_X86_INVD_BUG

entry_32.S contained a hardcoded alternative instruction entry, and the
format changed in commit 59e97e4d6fbc ("x86: Make alternative
instruction pointers relative").

Replace the hardcoded entry with the altinstruction_entry macro. This
fixes the 32-bit boot with CONFIG_X86_INVD_BUG=y.

Reported-and-tested-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Andy Lutomirski <luto@mit.edu>
Cc: Peter Anvin <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andy Lutomirski and committed by
Linus Torvalds
b4ca46e4 cbbfa38f

+2 -6
+2 -6
arch/x86/kernel/entry_32.S
··· 54 54 #include <asm/ftrace.h> 55 55 #include <asm/irq_vectors.h> 56 56 #include <asm/cpufeature.h> 57 + #include <asm/alternative-asm.h> 57 58 58 59 /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ 59 60 #include <linux/elf-em.h> ··· 874 873 661: pushl_cfi $do_general_protection 875 874 662: 876 875 .section .altinstructions,"a" 877 - .balign 4 878 - .long 661b 879 - .long 663f 880 - .word X86_FEATURE_XMM 881 - .byte 662b-661b 882 - .byte 664f-663f 876 + altinstruction_entry 661b, 663f, X86_FEATURE_XMM, 662b-661b, 664f-663f 883 877 .previous 884 878 .section .altinstr_replacement,"ax" 885 879 663: pushl $do_simd_coprocessor_error