]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/microcode: Ignore microcode loading interface for revision = -1
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Wed, 30 Aug 2023 15:53:24 +0000 (16:53 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Oct 2023 15:03:33 +0000 (16:03 +0100)
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>
Release-acked-by: Henry Wang <Henry.Wang@arm.com>
xen/arch/x86/cpu/microcode/core.c

index e5e03cad34647775267cdc2f12e555a0bff4c172..01f1dd47103748fc803d7f7980bd82e0ba52d393 100644 (file)
@@ -867,10 +867,23 @@ 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_INFO "Microcode loading disabled due to: %s\n",
+               "rev = ~0");
+        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();