mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/ucode: Fix error paths control_thread_fn()
These two early exits skipped re-enabling the watchdog, restoring the NMI
callback, and clearing the nmi_patch global pointer. Always execute the tail
of the function on the way out.
Fixes: 8dd4dfa92d ("x86/microcode: Synchronize late microcode loading")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
0ab316e7e1
commit
fc2e1f3aad
1 file changed
+3
-6
@@ -492,10 +492,7 @@ static int control_thread_fn(const struct microcode_patch *patch)
|
||||
ret = wait_for_condition(wait_cpu_callin, num_online_cpus(),
|
||||
MICROCODE_CALLIN_TIMEOUT_US);
|
||||
if ( ret )
|
||||
{
|
||||
set_state(LOADING_EXIT);
|
||||
return ret;
|
||||
}
|
||||
goto out;
|
||||
|
||||
/* Control thread loads ucode first while others are in NMI handler. */
|
||||
ret = alternative_call(ucode_ops.apply_microcode, patch);
|
||||
@@ -507,8 +504,7 @@ static int control_thread_fn(const struct microcode_patch *patch)
|
||||
{
|
||||
printk(XENLOG_ERR
|
||||
"Late loading aborted: CPU%u failed to update ucode\n", cpu);
|
||||
set_state(LOADING_EXIT);
|
||||
return ret;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Let primary threads load the given ucode update */
|
||||
@@ -539,6 +535,7 @@ static int control_thread_fn(const struct microcode_patch *patch)
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
/* Mark loading is done to unblock other threads */
|
||||
set_state(LOADING_EXIT);
|
||||
|
||||
|
||||