There are two callers of microcode_update_cpu(), and because one passes NULL
and one doesn't, there are effectively two disjoint pieces of logic wrapped in
a single function.
early_microcode_load()'s use skips all the microcode_cache handling, and is
just a simple patch application.
Use ucode_ops.apply_microcode() directly, and remove the non-cache path from
microcode_update_cpu(). This skips a redundant collect_cpu_info()
call (performed in early_microcode_init(), marginally earlier), and avoids
holding microcode_mutex when we're not interacting with microcode_cache at
all.
No functional change.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
alternative_vcall(ucode_ops.collect_cpu_info);
spin_lock(µcode_mutex);
- if ( patch )
- err = alternative_call(ucode_ops.apply_microcode, patch, flags);
- else if ( microcode_cache )
+ if ( microcode_cache )
{
err = alternative_call(ucode_ops.apply_microcode, microcode_cache,
flags);
*/
early_mod_idx = idx;
- rc = microcode_update_cpu(patch, 0);
+ rc = ucode_ops.apply_microcode(patch, 0);
unmap:
bootstrap_unmap();