diff mbox series

[v3,3/5] x86/microcode: Ignore microcode loading interface for revision = -1

Message ID 20230615154834.959-4-alejandro.vallejo@cloud.com (mailing list archive)
State Superseded
Headers show
Series Prevent attempting updates known to fail | expand

Commit Message

Alejandro Vallejo June 15, 2023, 3:48 p.m. UTC
Some hypervisors report ~0 as the microcode revision to mean "don't issue
microcode updates". Ignore the microcode loading interface in that case.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v3:
  * Moved from v2/patch3 (Andrew)
---
 xen/arch/x86/cpu/microcode/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jan Beulich June 19, 2023, 3:47 p.m. UTC | #1
On 15.06.2023 17:48, Alejandro Vallejo wrote:
> Some hypervisors report ~0 as the microcode revision to mean "don't issue
> microcode updates". Ignore the microcode loading interface in that case.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Aiui this is independent of patch 2, and hence could go in ahead of it?

Jan
diff mbox series

Patch

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 530e3e8267..1554fa38eb 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -860,6 +860,14 @@  int __init early_microcode_init(unsigned long *module_map,
     if ( ucode_ops.collect_cpu_info )
         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 )
+        ucode_ops.apply_microcode = NULL;
+
     if ( !ucode_ops.apply_microcode )
     {
         printk(XENLOG_WARNING "Microcode loading not available\n");