diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2009-01-21 18:04:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-22 03:24:02 -0500 |
commit | 066941bd4eeb159307a5d7d795100d0887c00442 (patch) | |
tree | 2bd4dfc033f72cbe0b3532140f54df1869dd6180 /arch/x86/kernel/cpu | |
parent | bdf21a49bab28f0d9613e8d8724ef9c9168b61b9 (diff) |
x86: unmask CPUID levels on Intel CPUs
Impact: Fixes crashes with misconfigured BIOSes on XSAVE hardware
Avuton Olrich reported early boot crashes with v2.6.28 and
bisected it down to dc1e35c6e95e8923cf1d3510438b63c600fee1e2
("x86, xsave: enable xsave/xrstor on cpus with xsave support").
If the CPUID limit bit in MSR_IA32_MISC_ENABLE is set, clear it to
make all CPUID information available. This is required for some
features to work, in particular XSAVE.
Reported-and-bisected-by: Avuton Olrich <avuton@gmail.com>
Tested-by: Avuton Olrich <avuton@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/cpu')
-rw-r--r-- | arch/x86/kernel/cpu/intel.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 8ea6929e974c..43c1dcf0bec7 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -29,6 +29,16 @@ | |||
29 | 29 | ||
30 | static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) | 30 | static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) |
31 | { | 31 | { |
32 | u64 misc_enable; | ||
33 | |||
34 | /* Unmask CPUID levels if masked */ | ||
35 | if (!rdmsrl_safe(MSR_IA32_MISC_ENABLE, &misc_enable) && | ||
36 | (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID)) { | ||
37 | misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID; | ||
38 | wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable); | ||
39 | c->cpuid_level = cpuid_eax(0); | ||
40 | } | ||
41 | |||
32 | if ((c->x86 == 0xf && c->x86_model >= 0x03) || | 42 | if ((c->x86 == 0xf && c->x86_model >= 0x03) || |
33 | (c->x86 == 0x6 && c->x86_model >= 0x0e)) | 43 | (c->x86 == 0x6 && c->x86_model >= 0x0e)) |
34 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); | 44 | set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); |