[PATCH] x86: fix x86 cpuid keys used in alternative_smp()
authorJan Beulich <jbeulich@novell.com>
Wed, 30 Aug 2006 17:37:10 +0000 (19:37 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 30 Aug 2006 23:05:15 +0000 (16:05 -0700)
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: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-i386/alternative.h
include/asm-x86_64/alternative.h

index 96adbabec7406fe2c285baad3629257ac8579702..bb3b6317c810205b3e8d8b3b3e47eb930797bf51 100644 (file)
@@ -116,7 +116,7 @@ static inline void alternatives_smp_switch(int smp) {}
                      "  .align 4\n"                                    \
                      "  .long 661b\n"            /* label */           \
                      "  .long 663f\n"            /* new instruction */ \
-                     "  .byte 0x68\n"            /* X86_FEATURE_UP */  \
+                     "  .byte " __stringify(X86_FEATURE_UP) "\n"       \
                      "  .byte 662b-661b\n"       /* sourcelen */       \
                      "  .byte 664f-663f\n"       /* replacementlen */  \
                      ".previous\n"                                     \
index aa67bfd1b3ce63a73a4f29467d9e5a664bcc1190..709ad3f0d354dac4ceec6a1d881bfe08c350678e 100644 (file)
@@ -4,6 +4,7 @@
 #ifdef __KERNEL__
 
 #include <linux/types.h>
+#include <asm/cpufeature.h>
 
 struct alt_instr {
        u8 *instr;              /* original instruction */
@@ -130,7 +131,7 @@ static inline void alternatives_smp_switch(int smp) {}
                      "  .align 8\n"                                    \
                      "  .quad 661b\n"            /* label */           \
                      "  .quad 663f\n"            /* new instruction */ \
-                     "  .byte 0x66\n"            /* X86_FEATURE_UP */  \
+                     "  .byte " __stringify(X86_FEATURE_UP) "\n"       \
                      "  .byte 662b-661b\n"       /* sourcelen */       \
                      "  .byte 664f-663f\n"       /* replacementlen */  \
                      ".previous\n"                                     \