From: Shaohua Li <shaohua.li@intel.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Jim McCloskey <mcclosk@ucsc.edu>, akpm <akpm@osdl.org>
Subject: [PATCH]CPUID workaround for intel CPU - Re: [PROBLEM] mtrr's not set, 2.6.13
Date: Thu, 29 Sep 2005 09:02:31 +0800 [thread overview]
Message-ID: <1127955751.4045.4.camel@linux-hp.sh.intel.com> (raw)
Hi Andrew,
This is patch to fix the Jim McCloskey's MTRR issue.
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>
---
linux-2.6.14-rc2-root/arch/i386/kernel/cpu/mtrr/main.c | 8 ++++++++
linux-2.6.14-rc2-root/arch/x86_64/kernel/setup.c | 6 ++++++
2 files changed, 14 insertions(+)
diff -puN arch/i386/kernel/cpu/mtrr/main.c~cpuid_errta arch/i386/kernel/cpu/mtrr/main.c
--- linux-2.6.14-rc2/arch/i386/kernel/cpu/mtrr/main.c~cpuid_errta 2005-09-29 08:35:34.000000000 +0800
+++ linux-2.6.14-rc2-root/arch/i386/kernel/cpu/mtrr/main.c 2005-09-29 08:37:16.000000000 +0800
@@ -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 &&
diff -puN arch/x86_64/kernel/setup.c~cpuid_errta arch/x86_64/kernel/setup.c
--- linux-2.6.14-rc2/arch/x86_64/kernel/setup.c~cpuid_errta 2005-09-29 08:35:34.000000000 +0800
+++ linux-2.6.14-rc2-root/arch/x86_64/kernel/setup.c 2005-09-29 08:37:48.000000000 +0800
@@ -992,6 +992,12 @@ static void __cpuinit init_intel(struct
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 (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+ boot_cpu_data.x86 == 0xF &&
+ boot_cpu_data.x86_model == 0x3 &&
+ boot_cpu_data.x86_mask == 0x4)
+ c->x86_phys_bits = 36;
}
if (c->x86 == 15)
_
next reply other threads:[~2005-09-29 0:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-29 1:02 Shaohua Li [this message]
2005-09-29 9:58 ` [PATCH]CPUID workaround for intel CPU - Re: [PROBLEM] mtrr's not set, 2.6.13 Mikael Pettersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1127955751.4045.4.camel@linux-hp.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcclosk@ucsc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox