microcode_update_one() currently assumes all microcode handlers are set or
none are. That won't be the case in a future patch, as apply_microcode()
may not be set while the others are. Hence, this patch allows reading the
microcode revision even if updating it is unavailable.
Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
/* Load a cached update to current cpu */
int microcode_update_one(void)
{
+ if ( ucode_ops.collect_cpu_info )
+ alternative_vcall(ucode_ops.collect_cpu_info);
+
if ( !ucode_ops.apply_microcode )
return -EOPNOTSUPP;
- alternative_vcall(ucode_ops.collect_cpu_info);
-
return microcode_update_cpu(NULL);
}