Get the "pre-boot" APIC ID via the x2APIC interface (RDMSR) if x2APIC is enabled (per APIC_BASE) instead of assuming xAPIC is enabled. UEFI SMP support[*] wants to use the pre-boot APIC ID helper to configure GS.base, i.e. before "resetting" the APIC to xAPIC mode. This causes problems for the SVM INIT-SIPI test, which sends APs back through the boot sequence without taking them out of x2APIC. Posting as a separate series mostly because I don't want to respin the entire UEFI series, but also because it's not impossible that someone will want to run KUT with firmware that forces x2APIC mode. [*] https://lore.kernel.org/all/20220615232943.1465490-1-seanjc@xxxxxxxxxx Sean Christopherson (2): x86: apic: Play nice with x2APIC being enabled when getting "pre-boot" ID x86: cstart64: Put APIC into xAPIC after loading TSS lib/x86/apic.c | 14 +++++++++----- x86/cstart64.S | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) base-commit: 7b2e41767bb8caf91972ee32e4ca85ec630584e2 -- 2.37.1.359.gd136c6c3e2-goog