Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 61171b8d authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds
Browse files

[PATCH] x86: fix x86 cpuid keys used in alternative_smp()



By hard-coding the cpuid keys for alternative_smp() rather than using
the symbolic constant it turned out that incorrect values were used on
both i386 (0x68 instead of 0x69) and x86-64 (0x66 instead of 0x68).

Signed-off-by: default avatarJan Beulich <jbeulich@novell.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 29fe5f3b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -116,7 +116,7 @@ static inline void alternatives_smp_switch(int smp) {}
		      "  .align 4\n"					\
		      "  .align 4\n"					\
		      "  .long 661b\n"            /* label */		\
		      "  .long 661b\n"            /* label */		\
		      "  .long 663f\n"		  /* new instruction */	\
		      "  .long 663f\n"		  /* new instruction */	\
		      "  .byte 0x68\n"            /* X86_FEATURE_UP */	\
		      "  .byte " __stringify(X86_FEATURE_UP) "\n"	\
		      "  .byte 662b-661b\n"       /* sourcelen */	\
		      "  .byte 662b-661b\n"       /* sourcelen */	\
		      "  .byte 664f-663f\n"       /* replacementlen */	\
		      "  .byte 664f-663f\n"       /* replacementlen */	\
		      ".previous\n"					\
		      ".previous\n"					\
+2 −1
Original line number Original line Diff line number Diff line
@@ -4,6 +4,7 @@
#ifdef __KERNEL__
#ifdef __KERNEL__


#include <linux/types.h>
#include <linux/types.h>
#include <asm/cpufeature.h>


struct alt_instr {
struct alt_instr {
	u8 *instr; 		/* original instruction */
	u8 *instr; 		/* original instruction */
@@ -130,7 +131,7 @@ static inline void alternatives_smp_switch(int smp) {}
		      "  .align 8\n"					\
		      "  .align 8\n"					\
		      "  .quad 661b\n"            /* label */		\
		      "  .quad 661b\n"            /* label */		\
		      "  .quad 663f\n"		  /* new instruction */	\
		      "  .quad 663f\n"		  /* new instruction */	\
		      "  .byte 0x66\n"            /* X86_FEATURE_UP */	\
		      "  .byte " __stringify(X86_FEATURE_UP) "\n"	\
		      "  .byte 662b-661b\n"       /* sourcelen */	\
		      "  .byte 662b-661b\n"       /* sourcelen */	\
		      "  .byte 664f-663f\n"       /* replacementlen */	\
		      "  .byte 664f-663f\n"       /* replacementlen */	\
		      ".previous\n"					\
		      ".previous\n"					\