Skip to content

Commit 922e512

Browse files
suryasaimadhugregkh
authored andcommitted
x86/microcode: Do not exit early from __reload_late()
commit 09e182d upstream. Vitezslav reported a case where the "Timeout during microcode update!" panic would hit. After a deeper look, it turned out that his .config had CONFIG_HOTPLUG_CPU disabled which practically made save_mc_for_early() a no-op. When that happened, the discovered microcode patch wasn't saved into the cache and the late loading path wouldn't find any. This, then, lead to early exit from __reload_late() and thus CPUs waiting until the timeout is reached, leading to the panic. In hindsight, that function should have been written so it does not return before the post-synchronization. Oh well, I know better now... Fixes: bb8c13d ("x86/microcode: Fix CPU synchronization routine") Reported-by: Vitezslav Samel <vitezslav@samel.cz> Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Vitezslav Samel <vitezslav@samel.cz> Tested-by: Ashok Raj <ashok.raj@intel.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180418081140.GA2439@pc11.op.pod.cz Link: https://lkml.kernel.org/r/20180421081930.15741-2-bp@alien8.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7c6bcaa commit 922e512

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • arch/x86/kernel/cpu/microcode

‎arch/x86/kernel/cpu/microcode/core.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,14 +564,12 @@ static int __reload_late(void *info)
564564
apply_microcode_local(&err);
565565
spin_unlock(&update_lock);
566566

567+
/* siblings return UCODE_OK because their engine got updated already */
567568
if (err > UCODE_NFOUND) {
568569
pr_warn("Error reloading microcode on CPU %d\n", cpu);
569-
return -1;
570-
/* siblings return UCODE_OK because their engine got updated already */
570+
ret = -1;
571571
} else if (err == UCODE_UPDATED || err == UCODE_OK) {
572572
ret = 1;
573-
} else {
574-
return ret;
575573
}
576574

577575
/*

0 commit comments

Comments
 (0)