diff options
author | Jan Beulich <jbeulich@novell.com> | 2007-10-17 12:04:41 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-17 14:17:04 -0400 |
commit | 32c464f5d9701db45bc1673288594e664065388e (patch) | |
tree | 342e6e8be44bcdc5bdc3ddd0cbf1ba15a0340602 /include/asm-x86/processor_32.h | |
parent | c861eff88c92d98ee661cf0d2fa978611edeaceb (diff) |
x86: multi-byte single instruction NOPs
Add support for and use the multi-byte NOPs recently documented to be
available on all PentiumPro and later processors.
This patch only applies cleanly on top of the "x86: misc.
constifications" patch sent earlier.
[ tglx: arch/x86 adaptation ]
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/alternative.c | 23 ++++++++++++++++++++++-
include/asm-x86/processor_32.h | 22 ++++++++++++++++++++++
include/asm-x86/processor_64.h | 22 ++++++++++++++++++++++
3 files changed, 66 insertions(+), 1 deletion(-)
Diffstat (limited to 'include/asm-x86/processor_32.h')
-rw-r--r-- | include/asm-x86/processor_32.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h index 38cc1061487e..83800e7496ee 100644 --- a/include/asm-x86/processor_32.h +++ b/include/asm-x86/processor_32.h | |||
@@ -677,6 +677,17 @@ static inline unsigned int cpuid_edx(unsigned int op) | |||
677 | #define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" | 677 | #define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" |
678 | #define K7_NOP8 K7_NOP7 ASM_NOP1 | 678 | #define K7_NOP8 K7_NOP7 ASM_NOP1 |
679 | 679 | ||
680 | /* P6 nops */ | ||
681 | /* uses eax dependencies (Intel-recommended choice) */ | ||
682 | #define P6_NOP1 GENERIC_NOP1 | ||
683 | #define P6_NOP2 ".byte 0x66,0x90\n" | ||
684 | #define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" | ||
685 | #define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" | ||
686 | #define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" | ||
687 | #define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" | ||
688 | #define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" | ||
689 | #define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" | ||
690 | |||
680 | #ifdef CONFIG_MK8 | 691 | #ifdef CONFIG_MK8 |
681 | #define ASM_NOP1 K8_NOP1 | 692 | #define ASM_NOP1 K8_NOP1 |
682 | #define ASM_NOP2 K8_NOP2 | 693 | #define ASM_NOP2 K8_NOP2 |
@@ -695,6 +706,17 @@ static inline unsigned int cpuid_edx(unsigned int op) | |||
695 | #define ASM_NOP6 K7_NOP6 | 706 | #define ASM_NOP6 K7_NOP6 |
696 | #define ASM_NOP7 K7_NOP7 | 707 | #define ASM_NOP7 K7_NOP7 |
697 | #define ASM_NOP8 K7_NOP8 | 708 | #define ASM_NOP8 K7_NOP8 |
709 | #elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \ | ||
710 | defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \ | ||
711 | defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4) | ||
712 | #define ASM_NOP1 P6_NOP1 | ||
713 | #define ASM_NOP2 P6_NOP2 | ||
714 | #define ASM_NOP3 P6_NOP3 | ||
715 | #define ASM_NOP4 P6_NOP4 | ||
716 | #define ASM_NOP5 P6_NOP5 | ||
717 | #define ASM_NOP6 P6_NOP6 | ||
718 | #define ASM_NOP7 P6_NOP7 | ||
719 | #define ASM_NOP8 P6_NOP8 | ||
698 | #else | 720 | #else |
699 | #define ASM_NOP1 GENERIC_NOP1 | 721 | #define ASM_NOP1 GENERIC_NOP1 |
700 | #define ASM_NOP2 GENERIC_NOP2 | 722 | #define ASM_NOP2 GENERIC_NOP2 |