Re: [PATCH] x86: introduce a new Linux defined feature flag forPAT support

From: Adrian Bunk
Date: Thu May 08 2008 - 09:13:23 EST


On Thu, May 08, 2008 at 02:49:19PM +0200, Thomas Gleixner wrote:
> On Wed, 7 May 2008, H. Peter Anvin wrote:
> > Linus Torvalds wrote:
> > >
> > > > *Certainly* I don't want anything like this crap:
> > > >
> > > > > - if (cpu_has_pat)
> > > > > + if (cpu_has_pat && cpu_has_pat_good)
> > >
> > > This in fact is likely the best part of it.
> > >
> > > Because that at least guarantees that we never say we have a good PAT when
> > > the hardware doesn't even report it.
> > >
> > > As it is, we seem to just blindly override hardware. It may be correct for
> > > all the models we override, but still..
> > >
> >
> > Yah, this is not good. We should mask out the bit, but never, ever, set it if
> > it was clear to begin with (unless we have it on really, *really*, good
> > authority.)
> >
> > I'm embarrassed to have let that slink by.
>
> /me too.
>
> Fix below.
>
> Thanks,
> tglx
>...
> The white list is kept for now to ensure that we can rely on known to
> work CPU types and concentrate on the software induced problems
> instead of fighthing CPU erratas and subtle wreckage caused by not yet
> verified CPUs. Once the PAT code has stabilized enough, we can remove
> the white list and open the can of worms.
>...
> +#ifdef CONFIG_X86_PAT
> +void __cpuinit validate_pat_support(struct cpuinfo_x86 *c)
> +{
> + switch (c->x86_vendor) {
> + case X86_VENDOR_AMD:
> + if (c->x86 >= 0xf && c->x86 <= 0x11)
> + return;
> + break;
> + case X86_VENDOR_INTEL:
> + if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15))
> + return;
> + break;
> + }
>...

This still has the inconsistent handling of future CPUs between AMD
and Intel.

IMHO we should also assume for future AMD CPUs that PAT will work until
proven otherwise.

Besides this, I didn't spot any problem in the patch.

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

--
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/