[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 01/10] x86/ucode: Turn microcode_init_cache() into a presmp_initcall



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@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 xen/arch/x86/cpu/microcode/core.c    | 4 +++-
 xen/arch/x86/include/asm/microcode.h | 1 -
 xen/arch/x86/setup.c                 | 2 --
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c 
b/xen/arch/x86/cpu/microcode/core.c
index 8d916d891e6e..9a2cc631d2aa 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -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)
diff --git a/xen/arch/x86/include/asm/microcode.h 
b/xen/arch/x86/include/asm/microcode.h
index a278773f8b5d..c62c131fd047 100644
--- a/xen/arch/x86/include/asm/microcode.h
+++ b/xen/arch/x86/include/asm/microcode.h
@@ -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 */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 177f4024abca..5db57e1b1af2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -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. */
-- 
2.39.5




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.