x86/apic: Sanitize APIC address setup
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Aug 2023 22:03:49 +0000 (15:03 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:20 +0000 (11:58 -0700)
commit81287ad65da5b82155f2eca03d81db5512802d16
tree0f020ffbc7bea6caed86060b68ac63ed38a6b116
parent5a88f354dcd8f19436bbda52f075276a5c70424f
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)
arch/x86/include/asm/mpspec.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/mpparse.c