[lkml]   [2003]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata
On Fri, 12 Sep 2003 20:48:01 +0200
Adrian Bunk <> wrote:

> > That's obsolete and could be removed. All 3dnow! code is dynamically patched depending on the CPUID.
> Quoting e.g. arch/i386/lib/memcpy.c:
> <-- snip -->
> void * memcpy(void * to, const void * from, size_t n)
> {
> #ifdef CONFIG_X86_USE_3DNOW
> return __memcpy3d(to, from, n);
> #else
> return __memcpy(to, from, n);
> #endif

No, it really works. The "3d" copy code uses actually MMX, which both the P4 and the K7 support fine

The only 3dnow! thing in there is that it uses 3dnow style prefetches (original MMX didn't
have prefetches), but these are handled in a transparent way since a long time. The code just
has an exception handler and patches them away if the prefetch ever faulted with an illegal


__asm__ __volatile__ (
"1: prefetch (%0)\n" /* This set is 28 bytes */
" prefetch 64(%0)\n"
" prefetch 128(%0)\n"
" prefetch 192(%0)\n"
" prefetch 256(%0)\n"
"2: \n"
".section .fixup, \"ax\"\n"
"3: movw $0x1AEB, 1b\n" /* jmp on 26 bytes */
" jmp 2b\n"

I admit the remaining #ifdefs and comments are a bit misleading though.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:48    [W:0.176 / U:12.464 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site