]> xenbits.xensource.com Git - xen.git/commitdiff
x86/ucode: Turn microcode_init_cache() into a presmp_initcall
authorAndrew Cooper <andrew.cooper3@citrix.com>
Sat, 26 Oct 2024 17:05:39 +0000 (18:05 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 5 Nov 2024 23:42:30 +0000 (23:42 +0000)
There's no need for microcode_init_cache() to be called exactly where it is in
__start_xen().  All that matters is it must be after xmalloc() is available
and before APs start up.

As a consequence, microcode_init_cache() runs a little later on boot now.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
xen/arch/x86/cpu/microcode/core.c
xen/arch/x86/include/asm/microcode.h
xen/arch/x86/setup.c

index 8d916d891e6e5ddc6fa0e16e48a2087f06d04611..9a2cc631d2aa33777463413e4b847f614b6e6a57 100644 (file)
@@ -819,8 +819,9 @@ static int __init early_update_cache(const void *data, size_t len)
     return rc;
 }
 
-int __init microcode_init_cache(struct boot_info *bi)
+static int __init cf_check microcode_init_cache(void)
 {
+    struct boot_info *bi = &xen_boot_info;
     int rc = 0;
 
     if ( !ucode_ops.apply_microcode )
@@ -838,6 +839,7 @@ int __init microcode_init_cache(struct boot_info *bi)
 
     return rc;
 }
+presmp_initcall(microcode_init_cache);
 
 /* BSP calls this function to parse ucode blob and then apply an update. */
 static int __init early_microcode_update_cpu(void)
index a278773f8b5d4793d88df307035b9acb931ef7ee..c62c131fd047a6eb2039293fb4437fa9716fe83d 100644 (file)
@@ -28,6 +28,5 @@ int microcode_update_one(void);
 
 struct boot_info;
 int early_microcode_init(struct boot_info *bi);
-int microcode_init_cache(struct boot_info *bi);
 
 #endif /* ASM_X86__MICROCODE_H */
index 177f4024abca2a8528740b380b83f27b2366a593..5db57e1b1af254579b391d4e1b22667fbfe6a439 100644 (file)
@@ -1952,8 +1952,6 @@ void asmlinkage __init noreturn __start_xen(void)
 
     timer_init();
 
-    microcode_init_cache(bi); /* Needs xmalloc() */
-
     tsx_init(); /* Needs microcode.  May change HLE/RTM feature bits. */
 
     calculate_raw_cpu_policy(); /* Needs microcode.  No other dependenices. */