Merge branch 'sched/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[pandora-kernel.git] / arch / x86 / kernel / cpu / addon_cpuid_features.c
index 238468a..84a8220 100644 (file)
@@ -1,11 +1,10 @@
-
 /*
  *     Routines to indentify additional cpu features that are scattered in
  *     cpuid space.
  */
-
 #include <linux/cpu.h>
 
+#include <asm/pat.h>
 #include <asm/processor.h>
 
 struct cpuid_bit {
@@ -48,3 +47,24 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
                        set_cpu_cap(c, cb->feature);
        }
 }
+
+#ifdef CONFIG_X86_PAT
+void __cpuinit validate_pat_support(struct cpuinfo_x86 *c)
+{
+       if (!cpu_has_pat)
+               pat_disable("PAT not supported by CPU.");
+
+       switch (c->x86_vendor) {
+       case X86_VENDOR_INTEL:
+               if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15))
+                       return;
+               break;
+       case X86_VENDOR_AMD:
+       case X86_VENDOR_CENTAUR:
+       case X86_VENDOR_TRANSMETA:
+               return;
+       }
+
+       pat_disable("PAT disabled. Not yet verified on this CPU type.");
+}
+#endif