Skip to content

Commit 8e8da02

Browse files
committed
x86: Fix boot failures on older AMD CPU's
People with old AMD chips are getting hung boots, because commit bcb80e5 ("x86, microcode, AMD: Add microcode revision to /proc/cpuinfo") moved the microcode detection too early into "early_init_amd()". At that point we are *so* early in the booth that the exception tables haven't even been set up yet, so the whole rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy); doesn't actually work: if the rdmsr does a GP fault (due to non-existant MSR register on older CPU's), we can't fix it up yet, and the boot fails. Fix it by simply moving the code to a slightly later point in the boot (init_amd() instead of early_init_amd()), since the kernel itself doesn't even really care about the microcode patchlevel at this point (or really ever: it's made available to user space in /proc/cpuinfo, and updated if you do a microcode load). Reported-tested-and-bisected-by: Larry Finger <[email protected]> Tested-by: Bob Tracy <[email protected]> Acked-by: Borislav Petkov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Srivatsa S. Bhat <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e5fd47b commit 8e8da02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/kernel/cpu/amd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c)
442442

443443
static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
444444
{
445-
u32 dummy;
446-
447445
early_init_amd_mc(c);
448446

449447
/*
@@ -473,12 +471,12 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c)
473471
set_cpu_cap(c, X86_FEATURE_EXTD_APICID);
474472
}
475473
#endif
476-
477-
rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
478474
}
479475

480476
static void __cpuinit init_amd(struct cpuinfo_x86 *c)
481477
{
478+
u32 dummy;
479+
482480
#ifdef CONFIG_SMP
483481
unsigned long long value;
484482

@@ -657,6 +655,8 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
657655
checking_wrmsrl(MSR_AMD64_MCx_MASK(4), mask);
658656
}
659657
}
658+
659+
rdmsr_safe(MSR_AMD64_PATCH_LEVEL, &c->microcode, &dummy);
660660
}
661661

662662
#ifdef CONFIG_X86_32

0 commit comments

Comments
 (0)