x86/mpparse: Prepare for callback separation
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2024 21:05:04 +0000 (22:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Feb 2024 21:07:40 +0000 (22:07 +0100)
In preparation of splitting the get_smp_config() callback, rename
default_get_smp_config() to mpparse_get_smp_config() and provide an early
and late wrapper.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Link: https://lore.kernel.org/r/20240212154639.433811243@linutronix.de
arch/x86/include/asm/mpspec.h
arch/x86/kernel/mpparse.c
arch/x86/kernel/x86_init.c

index c154dd7261e7ed8417075603b5ec0ae13f81ec45..72700ae4a7708dd5a41544c13a48a30bc0aefbce 100644 (file)
@@ -60,12 +60,16 @@ static inline void early_get_smp_config(void)
 extern void e820__memblock_alloc_reserved_mpc_new(void);
 extern int enable_update_mptable;
 extern void mpparse_find_mptable(void);
-extern void default_get_smp_config(unsigned int early);
+extern void mpparse_parse_early_smp_config(void);
+extern void mpparse_parse_smp_config(void);
+extern void mpparse_get_smp_config(unsigned int early);
 #else
 static inline void e820__memblock_alloc_reserved_mpc_new(void) { }
-#define enable_update_mptable  0
-#define mpparse_find_mptable   x86_init_noop
-#define default_get_smp_config x86_init_uint_noop
+#define enable_update_mptable          0
+#define mpparse_find_mptable           x86_init_noop
+#define mpparse_parse_early_smp_config x86_init_noop
+#define mpparse_parse_smp_config       x86_init_noop
+#define mpparse_get_smp_config         x86_init_uint_noop
 #endif
 
 int generic_processor_info(int apicid);
index 86acccdbd6315b538cc0ca90b296bdff2d1bbf35..b22093d2265b80e6cb3fc42110083288aeb77d0a 100644 (file)
@@ -473,7 +473,7 @@ static int __init check_physptr(struct mpf_intel *mpf, unsigned int early)
 /*
  * Scan the memory blocks for an SMP configuration block.
  */
-void __init default_get_smp_config(unsigned int early)
+void __init mpparse_get_smp_config(unsigned int early)
 {
        struct mpf_intel *mpf;
 
@@ -538,6 +538,16 @@ out:
        early_memunmap(mpf, sizeof(*mpf));
 }
 
+void __init mpparse_parse_early_smp_config(void)
+{
+       mpparse_get_smp_config(true);
+}
+
+void __init mpparse_parse_smp_config(void)
+{
+       mpparse_get_smp_config(false);
+}
+
 static void __init smp_reserve_memory(struct mpf_intel *mpf)
 {
        memblock_reserve(mpf->physptr, get_mpc_size(mpf->physptr));
index 0bbef495a43ff1b3e717077e084b115ea5ff0750..5d86d578297148aec756b66289c5cbeab0c238ad 100644 (file)
@@ -71,7 +71,7 @@ struct x86_init_ops x86_init __initdata = {
        .mpparse = {
                .setup_ioapic_ids       = x86_init_noop,
                .find_mptable           = mpparse_find_mptable,
-               .get_smp_config         = default_get_smp_config,
+               .get_smp_config         = mpparse_get_smp_config,
        },
 
        .irqs = {