]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] x86_64/i386: Compute correct MTRR mask on early Noconas
authorAndi Kleen <ak@suse.de>
Sun, 30 Oct 2005 06:49:38 +0000 (01:49 -0500)
committerChris Wright <chrisw@osdl.org>
Thu, 24 Nov 2005 22:10:11 +0000 (14:10 -0800)
Force correct address space size for MTRR on some 64bit Intel Xeons

They report 40bit, but only have 36bits of physical address space.
This caused problems with setting up the correct masks for MTRR,
resulting in incorrect MTRRs.

CPUID workaround for steppings 0F33h(supporting x86) and 0F34h(supporting x86
and EM64T). Detail info can be found at:
http://download.intel.com/design/Xeon/specupdt/30240216.pdf
http://download.intel.com/design/Pentium4/specupdt/30235221.pdf

Signed-off-by: Shaohua Li<shaohua.li@intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/i386/kernel/cpu/mtrr/main.c
arch/x86_64/kernel/setup.c

index dd4ebd6af7e4cc5e014dff4ab72a3a1ac2650619..1e9db198c440e3a1dac2c5bdcbe38038a31f3c26 100644 (file)
@@ -626,6 +626,14 @@ void __init mtrr_bp_init(void)
                if (cpuid_eax(0x80000000) >= 0x80000008) {
                        u32 phys_addr;
                        phys_addr = cpuid_eax(0x80000008) & 0xff;
+                       /* CPUID workaround for Intel 0F33/0F34 CPU */
+                       if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+                           boot_cpu_data.x86 == 0xF &&
+                           boot_cpu_data.x86_model == 0x3 &&
+                           (boot_cpu_data.x86_mask == 0x3 ||
+                            boot_cpu_data.x86_mask == 0x4))
+                               phys_addr = 36;
+
                        size_or_mask = ~((1 << (phys_addr - PAGE_SHIFT)) - 1);
                        size_and_mask = ~size_or_mask & 0xfff00000;
                } else if (boot_cpu_data.x86_vendor == X86_VENDOR_CENTAUR &&
index cb28df14ff6fea87991daba07241b86835db30ee..55184284fbfcfba8f28ffe89a3abd2e34fb5e801 100644 (file)
@@ -993,6 +993,11 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c)
                unsigned eax = cpuid_eax(0x80000008);
                c->x86_virt_bits = (eax >> 8) & 0xff;
                c->x86_phys_bits = eax & 0xff;
+               /* CPUID workaround for Intel 0F34 CPU */
+               if (c->x86_vendor == X86_VENDOR_INTEL &&
+                   c->x86 == 0xF && c->x86_model == 0x3 &&
+                   c->x86_mask == 0x4)
+                       c->x86_phys_bits = 36;
        }
 
        if (c->x86 == 15)