Re: [PATCH] Mutilated form of Andi Kleen's AMD prefetch errata patch

Dave Jones
2003-09-30T13:26:14Z

On Tue, Sep 30, 2003 at 08:38:14AM +0100, Jamie Lokier wrote:
> diff -urN --exclude-from=dontdiff orig-2.6.0-test6/arch/i386/Kconfig dual-2.6.0-test6/arch/i386/Kconfig
> --- orig-2.6.0-test6/arch/i386/Kconfig 2003-09-30 05:39:33.467103692 +0100
> +++ dual-2.6.0-test6/arch/i386/Kconfig 2003-09-30 06:05:19.868623767 +0100
> @@ -397,6 +397,12 @@
> depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6
> default y
>
> +config X86_PREFETCH_FIXUP
> + bool
> + depends on MK7 || MK8
> + default y
> +
> +
> config HPET_TIMER
> bool "HPET Timer Support"
> help
> diff -urN --exclude-from=dontdiff orig-2.6.0-test6/arch/i386/kernel/cpu/common.c dual-2.6.0-test6/arch/i386/kernel/cpu/common.c
> --- orig-2.6.0-test6/arch/i386/kernel/cpu/common.c 2003-09-30 05:39:33.871035696 +0100
> +++ dual-2.6.0-test6/arch/i386/kernel/cpu/common.c 2003-09-30 06:03:46.222851345 +0100
> @@ -327,6 +327,17 @@
> * we do "generic changes."
> */
>
> + /* Prefetch works ok? */
> +#ifndef CONFIG_X86_PREFETCH_FIXUP
> + if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 6)
> +#endif
> + {
> + if (cpu_has(c, X86_FEATURE_XMM))
> + set_bit(X86_FEATURE_XMM_PREFETCH, c->x86_capability);
> + if (cpu_has(c, X86_FEATURE_3DNOW))
> + set_bit(X86_FEATURE_3DNOW_PREFETCH, c->x86_capability);
> + }
> +
> /* TSC disabled? */
> if ( tsc_disable )

This looks to be completely gratuitous. Why disable it when we have the
ability to work around it ?

Dave

--
Dave Jones http://www.codemonkey.org.uk