Re: i686 quirk for AMD Geode

From: Andres Salomon
Date: Sun Nov 08 2009 - 13:48:16 EST


On Sun, 8 Nov 2009 19:22:47 +0100
Matteo Croce <technoboy85@xxxxxxxxx> wrote:

> On Sun, Nov 8, 2009 at 5:05 PM, Andres Salomon
> <dilinger@xxxxxxxxxxxxxxx> wrote:
> > See comment below. ÂBTW, how does this affect performance on LXs?
> > Do you have any hard numbers for common tasks?
> >
> > On Sat, 7 Nov 2009 12:11:55 +0100
> > Matteo Croce <technoboy85@xxxxxxxxx> wrote:
> > [...]
> >>
> >> --- a/arch/x86/kernel/Makefile    Â2009-11-06 15:06:52.246223989
> >> +0100 +++ b/arch/x86/kernel/Makefile Â2009-11-06
> >> 15:07:04.294054613 +0100 @@ -89,7 +89,7 @@
> >> Âobj-$(CONFIG_HPET_TIMER) Â Â += hpet.o
> >>
> >> Âobj-$(CONFIG_K8_NB) Â Â Â Â Â+= k8.o
> >> -obj-$(CONFIG_MGEODE_LX) Â Â Â Â Â Â Â+= geode_32.o mfgpt_32.o
> >> +obj-$(CONFIG_MGEODE_LX) Â Â Â Â Â Â Â+= geode_32.o mfgpt_32.o
> >> nopl_emu.o obj-$(CONFIG_DEBUG_RODATA_TEST) Â Â+= test_rodata.o
> >> Âobj-$(CONFIG_DEBUG_NX_TEST) Â+= test_nx.o
> >>
> >> --- a/arch/x86/kernel/cpu/amd.c    2009-11-06 15:06:52.254223805
> >> +0100 +++ b/arch/x86/kernel/cpu/amd.c 2009-11-06
> >> 15:07:04.294054613 +0100 @@ -138,8 +138,10 @@
> >> Â Â Â }
> >>
> >> Â Â Â if (c->x86_model == 10) {
> >> - Â Â Â Â Â Â /* AMD Geode LX is model 10 */
> >> - Â Â Â Â Â Â /* placeholder for any needed mods */
> >> + Â Â Â Â Â Â /* Geode only lacks the NOPL instruction to be i686,
> >> + Â Â Â Â Â Â Â Âbut we can emulate it in the exception handler
> >> + Â Â Â Â Â Â Â Âand promote it to a class 6 cpu */
> >> + Â Â Â Â Â Â boot_cpu_data.x86 = 6;
> >> Â Â Â Â Â Â Â return;
> >> Â Â Â }
> >
> > If you're going to update this, you also need to make sure that
> > you're not breaking things that check it. ÂFor example,
> > arch/x86/include/asm/geode.h has an is_geode_lx check that expects
> > boot_cpu_data.x86 to be 5. ÂPlease be sure to update all these
> > places when creating a patch like this.
> >
>
> Right, but what if is_geode_lx() is called befor the x86.id change
> takes effect? Maybe something like this?
>
> --- a/arch/x86/include/asm/geode.h 2009-11-08 19:13:43.531117343 +0100
> +++ b/arch/x86/include/asm/geode.h 2009-11-08 19:19:42.130618023
> +0100 @@ -177,7 +177,7 @@
> static inline int is_geode_lx(void)
> {
> return ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
> - (boot_cpu_data.x86 == 5) &&
> + (boot_cpu_data.x86 == 5 || boot_cpu_data.x86 == 6) &&
> (boot_cpu_data.x86_model == 10));
> }


Yeah, that looks better.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/