diff options
Diffstat (limited to 'arch/x86/kernel/cpu/microcode/amd.c')
-rw-r--r-- | arch/x86/kernel/cpu/microcode/amd.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 0624957aa068..07b5fc00b188 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c | |||
@@ -504,6 +504,7 @@ static enum ucode_state apply_microcode_amd(int cpu) | |||
504 | struct microcode_amd *mc_amd; | 504 | struct microcode_amd *mc_amd; |
505 | struct ucode_cpu_info *uci; | 505 | struct ucode_cpu_info *uci; |
506 | struct ucode_patch *p; | 506 | struct ucode_patch *p; |
507 | enum ucode_state ret; | ||
507 | u32 rev, dummy; | 508 | u32 rev, dummy; |
508 | 509 | ||
509 | BUG_ON(raw_smp_processor_id() != cpu); | 510 | BUG_ON(raw_smp_processor_id() != cpu); |
@@ -521,9 +522,8 @@ static enum ucode_state apply_microcode_amd(int cpu) | |||
521 | 522 | ||
522 | /* need to apply patch? */ | 523 | /* need to apply patch? */ |
523 | if (rev >= mc_amd->hdr.patch_id) { | 524 | if (rev >= mc_amd->hdr.patch_id) { |
524 | c->microcode = rev; | 525 | ret = UCODE_OK; |
525 | uci->cpu_sig.rev = rev; | 526 | goto out; |
526 | return UCODE_OK; | ||
527 | } | 527 | } |
528 | 528 | ||
529 | if (__apply_microcode_amd(mc_amd)) { | 529 | if (__apply_microcode_amd(mc_amd)) { |
@@ -531,13 +531,21 @@ static enum ucode_state apply_microcode_amd(int cpu) | |||
531 | cpu, mc_amd->hdr.patch_id); | 531 | cpu, mc_amd->hdr.patch_id); |
532 | return UCODE_ERROR; | 532 | return UCODE_ERROR; |
533 | } | 533 | } |
534 | pr_info("CPU%d: new patch_level=0x%08x\n", cpu, | ||
535 | mc_amd->hdr.patch_id); | ||
536 | 534 | ||
537 | uci->cpu_sig.rev = mc_amd->hdr.patch_id; | 535 | rev = mc_amd->hdr.patch_id; |
538 | c->microcode = mc_amd->hdr.patch_id; | 536 | ret = UCODE_UPDATED; |
537 | |||
538 | pr_info("CPU%d: new patch_level=0x%08x\n", cpu, rev); | ||
539 | 539 | ||
540 | return UCODE_UPDATED; | 540 | out: |
541 | uci->cpu_sig.rev = rev; | ||
542 | c->microcode = rev; | ||
543 | |||
544 | /* Update boot_cpu_data's revision too, if we're on the BSP: */ | ||
545 | if (c->cpu_index == boot_cpu_data.cpu_index) | ||
546 | boot_cpu_data.microcode = rev; | ||
547 | |||
548 | return ret; | ||
541 | } | 549 | } |
542 | 550 | ||
543 | static int install_equiv_cpu_table(const u8 *buf) | 551 | static int install_equiv_cpu_table(const u8 *buf) |