x86/ucode: Fix error paths in apply_microcode()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 20 Mar 2020 20:03:32 +0000 (20:03 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 26 Mar 2020 18:57:45 +0000 (18:57 +0000)
commitd2a0a96cf76603b2e2b87c3ce80c3f9d098327d4
treebafef7d602110f2f6d35c23df7363cb483fc8986
parent13ed5d49a4214dc3521d4af7bfcf13fbcf5bfd63
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>
xen/arch/x86/cpu/microcode/amd.c
xen/arch/x86/cpu/microcode/intel.c