Skip to content

Commit

Permalink
x86: unmask CPUID levels on Intel CPUs, fix
Browse files Browse the repository at this point in the history
Impact: fix boot hang on pre-model-15 Intel CPUs

rdmsrl_safe() does not work in very early bootup code yet, because we
dont have the pagefault handler installed yet so exception section
does not get parsed. rdmsr_safe() will just crash and hang the bootup.

So limit the MSR_IA32_MISC_ENABLE MSR read to those CPU types that
support it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Jan 26, 2009
1 parent ef5fa0a commit 99fb4d3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions arch/x86/kernel/cpu/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@

static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
{
u64 misc_enable;

/* Unmask CPUID levels if masked */
if (!rdmsrl_safe(MSR_IA32_MISC_ENABLE, &misc_enable) &&
(misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID)) {
misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
c->cpuid_level = cpuid_eax(0);
/* Unmask CPUID levels if masked: */
if (c->x86 == 6 && c->x86_model >= 15) {
u64 misc_enable;

rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable);

if (misc_enable & MSR_IA32_MISC_ENABLE_LIMIT_CPUID) {
misc_enable &= ~MSR_IA32_MISC_ENABLE_LIMIT_CPUID;
wrmsrl(MSR_IA32_MISC_ENABLE, misc_enable);
c->cpuid_level = cpuid_eax(0);
}
}

if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
Expand Down

0 comments on commit 99fb4d3

Please sign in to comment.