[PATCH] x86: pat cpu feature bit setting for known cpus
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index eb94460..b186047 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -309,6 +309,19 @@ static void __cpuinit early_get_cap(struct cpuinfo_x86 *c)}
+ clear_cpu_cap(c, X86_FEATURE_PAT);
+
+ switch (c->x86_vendor) {
+ case X86_VENDOR_AMD:
+ if (c->x86 >= 0xf && c->x86 <= 0x11)
+ set_cpu_cap(c, X86_FEATURE_PAT);
+ break;
+ case X86_VENDOR_INTEL:
+ if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15))
+ set_cpu_cap(c, X86_FEATURE_PAT);
+ break;
+ }
+
}/*
@@ -397,6 +410,18 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
init_scattered_cpuid_features(c);
}+ clear_cpu_cap(c, X86_FEATURE_PAT);
+
+ switch (c->x86_vendor) {
+ case X86_VENDOR_AMD:
+ if (c->x86 >= 0xf && c->x86 <= 0x11)
+ set_cpu_cap(c, X86_FEATURE_PAT);
+ break;
+ case X86_VENDOR_INTEL:
+ if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15))
+ set_cpu_cap(c, X86_FEATURE_PAT);
+ break;
+ }
}static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c
index 3f1dc97..ddaaaaa 100644
--- a/arch/x86/kernel/setup_64.c
+++ b/arch/x86/kernel/setup_64.c
@@ -979,12 +979,19 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
if (c->extended_cpuid_level >= 0x80000007)
c->x86_power = cpuid_edx(0x80000007);+
+ clear_cpu_cap(c, X86_FEATURE_PAT);
+
switch (c->x86_vendor) {
case X86_VENDOR_AMD:
early_init_amd(c);
+ if (c->x86 >= 0xf && c->x86 <= 0x11)
+ set_cpu_cap(c, X86_FEATURE_PAT);
break;
case X86_VENDOR_INTEL:
early_init_intel(c);
+ if (c->x86 == 0xF || (c->x86 == 6 && c...
just a general comment on things like this... "x->x86 <= 0x11" ensures
note that you didn't limit intel the same way... at least for the numerous
core2 processor models.-dean
--
one more copy...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
yes. just want to leave one stub, so could add other cap setting if
for 64 bit.
YH
--
OK, note previous question: what is the motivation for having this as a
whitelist (as opposed to a blacklist)?-hpa
--
Venkatesh could tell?
YH
--
Main reason for white-list at this point is not to be side-tracked by
real or potential erratas on older CPUs. Focussing on getting the support for
this feature on current and future CPUs. If older CPUs have survived all these
days without this feature, they should be doing OK.Other reason being the amount of testing we get on those older systems. I mean,
any regression on some specific CPU is hard to find unless it is being tested
or someone audits all the errata documents to prepare the blacklist (Unless
we want to have big blacklist which is just !current_whitelist). We do not
have any self test that can detect and report any problematic CPUs that we
can add to the blacklist.Having said that, if there is a need for this on older CPUs, I am OK with
having this as a blacklist.Thanks,
Venki--
well, the upside would be that since most testing of Linux kernels is
done on _old_ hardware (people tend to risk their old hw first ;-), we'd
get faster convergence of the codebase, even though we have the risk of
erratas (known and unknown ones alike). Code that artificially limits
its utility is almost always slow to stabilize.Ingo
--
Yes, using a whitelist of this type is wrong, IMO, and smells faintly of
vendor-lockin.-hpa
--
By the way, I want to clarify: I didn't mean it was *intended* as
vendor-lockin, just that it's an undesirable effect of this.-hpa
--
if the PAT works, we may need to trim the memory according to MTRR, right?
YH
--
That doesn't seem like it's specific to PAT?
-hpa
--
could page table to set WRBACK the range that is not covered by MTRR in e820..
YH
--
We have to trim anyway... lest we end up using uncached memory and then
we're in a world of hurt.-hpa
--
Trimming of e820 memory is already done by Jesse's patch here
commit 99fc8d424bc5d80
Are you referring to similar thing?Thanks,
Venki--
On Tue, Mar 25, 2008 at 4:38 PM, Pallipadi, Venkatesh
Yes.YH
--
thanks, applied - we need this to widen the testing scope of the PAT
changes.Ingo
--
| Sunil Naidu | Re: Linux 2.6.20-rc6 |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Linus Torvalds | Re: init's children list is long and slows reaping children. |
| David Miller | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Andrew Morton | Re: [BUG] New Kernel Bugs |
git: | |
