x86/of: Fix the APIC address registration
authorThomas Gleixner <tglx@linutronix.de>
Tue, 8 Aug 2023 22:03:47 +0000 (15:03 -0700)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 9 Aug 2023 18:58:19 +0000 (11:58 -0700)
commit2906a67ac83b06b874b32bf6413a8d5e186fc33e
tree5366d5375f7f75ab5cea834e14ddeb098f66f2f5
parent004671e5c9335736ef808482bfc69cccd93cccc5
x86/of: Fix the APIC address registration

The device tree APIC parser tries to force-enable the local APIC when it is
not set in CPUID. apic_force_enable() registers the boot CPU apic on
success.

If that succeeds then dtb_lapic_setup() registers the local APIC again
eventually with a different address.

Rewrite the code so that it only registers it once.

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/kernel/devicetree.c