Commit 700a4acb authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] Fix prefetch patching in 2.5-bk

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.
parent fb346e7b
...@@ -564,7 +564,7 @@ static inline void rep_nop(void) ...@@ -564,7 +564,7 @@ static inline void rep_nop(void)
#define ARCH_HAS_PREFETCH #define ARCH_HAS_PREFETCH
extern inline void prefetch(const void *x) extern inline void prefetch(const void *x)
{ {
alternative_input(ASM_NOP3, alternative_input(ASM_NOP4,
"prefetchnta (%1)", "prefetchnta (%1)",
X86_FEATURE_XMM, X86_FEATURE_XMM,
"r" (x)); "r" (x));
...@@ -578,7 +578,7 @@ extern inline void prefetch(const void *x) ...@@ -578,7 +578,7 @@ extern inline void prefetch(const void *x)
spinlocks to avoid one state transition in the cache coherency protocol. */ spinlocks to avoid one state transition in the cache coherency protocol. */
extern inline void prefetchw(const void *x) extern inline void prefetchw(const void *x)
{ {
alternative_input(ASM_NOP3, alternative_input(ASM_NOP4,
"prefetchw (%1)", "prefetchw (%1)",
X86_FEATURE_3DNOW, X86_FEATURE_3DNOW,
"r" (x)); "r" (x));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment