x86/ucode: Fix error paths in apply_microcode()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Apr 2020 08:14:32 +0000 (10:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Apr 2020 08:14:32 +0000 (10:14 +0200)
commitac3b39ce8386de5066760425e6895dc7735248a2
tree7b5329c92a569754c47643a1a368bf62c3f26927
parent480d9b47840a354c56eacece5c1ea206c577ee15
x86/ucode: Fix error paths in apply_microcode()

In the unlikley case that patch application completes, but the resutling
revision isn't expected, sig->rev doesn't get updated to match reality.

It will get adjusted the next time collect_cpu_info() gets called, but in the
meantime Xen might operate on a stale value.  Nothing good will come of this.

Rewrite the logic to always update the stashed revision, before worrying about
whether the attempt was a success or failure.

Take the opportunity to make the printk() messages as consistent as possible.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wl@xen.org>
master commit: d2a0a96cf76603b2e2b87c3ce80c3f9d098327d4
master date: 2020-03-26 18:57:45 +0000
xen/arch/x86/microcode_amd.c
xen/arch/x86/microcode_intel.c