Re: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata

Jamie Lokier
2003-09-16T11:55:19Z

Mikael Pettersson wrote:
> extern inline void prefetch(const void *x)
> {
> if (cpu_data[0].x86_vendor == X86_VENDOR_AMD)
> return; /* Some athlons fault if the address is bad */
> alternative_input(ASM_NOP4,
> "prefetchnta (%1)",
> X86_FEATURE_XMM,
> "r" (x));
> }
>
> A dynamic test at each occurrence. That's truly horrible.

Is there any reason why alternative_input() cannot be used by itself?
Another synthetic feature bit would sort this out, making a kernel
that always works on AMD, and is optimised for AMD if the fixup is
configured in: X86_FEATURE_XMM_PREFETCH.

-- Jamie