diff options
author | 2023-08-08 15:03:49 -0700 | |
---|---|---|
committer | 2023-08-09 11:58:20 -0700 | |
commit | 81287ad65da5b82155f2eca03d81db5512802d16 (patch) | |
tree | 0f020ffbc7bea6caed86060b68ac63ed38a6b116 /arch/x86/kernel/mpparse.c | |
parent | x86/apic: Split register_apic_address() (diff) | |
download | wireguard-linux-81287ad65da5b82155f2eca03d81db5512802d16.tar.xz wireguard-linux-81287ad65da5b82155f2eca03d81db5512802d16.zip |
x86/apic: Sanitize APIC address setup
Convert places which just write mp_lapic_addr and let them register the
local APIC address directly instead of relying on magic other code to do
so.
Add a WARN_ON() into register_lapic_address() which is raised when
register_lapic_address() is invoked more than once during boot.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Tested-by: Sohil Mehta <sohil.mehta@intel.com>
Tested-by: Juergen Gross <jgross@suse.com> # Xen PV (dom0 and unpriv. guest)
Diffstat (limited to '')
-rw-r--r-- | arch/x86/kernel/mpparse.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 333dee2cfbb8..b223922248e9 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -375,11 +375,6 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type) int i; /* - * local APIC has default address - */ - mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; - - /* * 2 CPUs, numbered 0 & 1. */ processor.type = MP_PROCESSOR; @@ -520,10 +515,8 @@ void __init default_get_smp_config(unsigned int early) */ if (mpf->feature1) { if (early) { - /* - * local APIC has default address - */ - mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; + /* Local APIC has default address */ + register_lapic_address(APIC_DEFAULT_PHYS_BASE); goto out; } |