[PATCH] Fix prefetch patching in 2.5-bk

From: Andi Kleen (ak@muc.de)
Date: Wed Apr 30 2003 - 19:15:12 EST


Brown paperbag time. I forgot to take the modrm byte in account
with the prefetch patch replacement. With 3.2 it worked because
it used the right registers in my configuration.

But gcc 2.96 uses a different register in __dpath and the prefetch becomes
4 bytes with modrm and the original nop needs to be as long as that too.

If your machine BUG()s in apply_alternatives at booting
or module loading you need this patch.

Linus please apply.

-Andi

Index: linux/include/asm-i386/processor.h
===================================================================
RCS file: /home/cvs/linux-2.5/include/asm-i386/processor.h,v
retrieving revision 1.48
diff -u -u -r1.48 processor.h
--- linux/include/asm-i386/processor.h 30 Apr 2003 14:32:05 -0000 1.48
+++ linux/include/asm-i386/processor.h 30 Apr 2003 22:48:26 -0000
@@ -564,7 +564,7 @@
 #define ARCH_HAS_PREFETCH
 extern inline void prefetch(const void *x)
 {
- alternative_input(ASM_NOP3,
+ alternative_input(ASM_NOP4,
                           "prefetchnta (%1)",
                           X86_FEATURE_XMM,
                           "r" (x));
@@ -578,7 +578,7 @@
    spinlocks to avoid one state transition in the cache coherency protocol. */
 extern inline void prefetchw(const void *x)
 {
- alternative_input(ASM_NOP3,
+ alternative_input(ASM_NOP4,
                           "prefetchw (%1)",
                           X86_FEATURE_3DNOW,
                           "r" (x));
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:37 EST