x86/mm/numa: Move early mptable evaluation into common code
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Feb 2024 21:05:16 +0000 (22:05 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Feb 2024 21:07:41 +0000 (22:07 +0100)
There is no reason to have the early mptable evaluation conditionally
invoked only from the AMD numa topology code.

Make it explicit and invoke it from setup_arch() right after the
corresponding ACPI init call. Remove the pointless wrapper and invoke
x86_init::mpparse::early_parse_smp_config() directly.

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.931761608@linutronix.de
arch/x86/include/asm/mpspec.h
arch/x86/kernel/setup.c
arch/x86/mm/amdtopology.c

index 82480b7d01f0296551ff16a0459d4fdd3f8ffade..b423d11e002d13a32a78e39ef89b744737e1ca0e 100644 (file)
@@ -46,11 +46,6 @@ extern int smp_found_config;
 # define smp_found_config 0
 #endif
 
-static inline void early_get_smp_config(void)
-{
-       x86_init.mpparse.early_parse_smp_cfg();
-}
-
 #ifdef CONFIG_X86_MPPARSE
 extern void e820__memblock_alloc_reserved_mpc_new(void);
 extern int enable_update_mptable;
index 1a3d66f17487dfc8cf46e2fb9158f3a58f525a4c..b1e52ac164b1e45f78264ffc076fd3e3477ddd96 100644 (file)
@@ -1088,7 +1088,9 @@ void __init setup_arch(char **cmdline_p)
 
        early_platform_quirks();
 
+       /* Some platforms need the APIC registered for NUMA configuration */
        early_acpi_boot_init();
+       x86_init.mpparse.early_parse_smp_cfg();
 
        x86_flattree_get_config();
 
index 5681b997b35748041edf9159f1f706ca15374266..9332b36a10915c1f93004541e03de0530ecd755c 100644 (file)
@@ -161,13 +161,6 @@ int __init amd_numa_init(void)
         */
        cores = topology_get_domain_size(TOPO_CORE_DOMAIN);
 
-       /*
-        * Scan MPTABLE to map the local APIC and ensure that the boot CPU
-        * APIC ID is valid. This is required because on pre ACPI/SRAT
-        * systems IO-APICs are mapped before the boot CPU.
-        */
-       early_get_smp_config();
-
        apicid = boot_cpu_physical_apicid;
        if (apicid > 0)
                pr_info("BSP APIC ID: %02x\n", apicid);