Message ID | 20230622174219.8871-3-alejandro.vallejo@cloud.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Prevent attempting updates known to fail | expand |
On 22.06.2023 19:42, Alejandro Vallejo wrote: > --- a/xen/arch/x86/cpu/microcode/core.c > +++ b/xen/arch/x86/cpu/microcode/core.c > @@ -867,10 +867,21 @@ int __init early_microcode_init(unsigned long *module_map, > return -ENODEV; > } > > - microcode_grab_module(module_map, mbi); > - > ucode_ops.collect_cpu_info(); > > + /* > + * Some hypervisors deliberately report a microcode revision of -1 to > + * mean that they will not accept microcode updates. We take the hint > + * and ignore the microcode interface in that case. > + */ > + if ( this_cpu(cpu_sig).rev == ~0 ) { Nit: Style (brace placement). Can probably be fixed up while committing, if no other issues arise. Jan
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c index bec8b55db2..e67d143c97 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -867,10 +867,21 @@ int __init early_microcode_init(unsigned long *module_map, return -ENODEV; } - microcode_grab_module(module_map, mbi); - ucode_ops.collect_cpu_info(); + /* + * Some hypervisors deliberately report a microcode revision of -1 to + * mean that they will not accept microcode updates. We take the hint + * and ignore the microcode interface in that case. + */ + if ( this_cpu(cpu_sig).rev == ~0 ) { + printk(XENLOG_WARNING "Microcode loading disabled\n"); + ucode_ops.apply_microcode = NULL; + return -ENODEV; + } + + microcode_grab_module(module_map, mbi); + if ( ucode_mod.mod_end || ucode_blob.size ) rc = early_microcode_update_cpu();