]> www.infradead.org Git - users/hch/misc.git/commitdiff
x86/xen: mark boot CPU of PV guest in MSR_IA32_APICBASE
authorJuergen Gross <jgross@suse.com>
Fri, 4 Oct 2024 10:22:12 +0000 (12:22 +0200)
committerJuergen Gross <jgross@suse.com>
Tue, 8 Oct 2024 14:18:57 +0000 (16:18 +0200)
Recent topology checks of the x86 boot code uncovered the need for
PV guests to have the boot cpu marked in the APICBASE MSR.

Fixes: 9d22c96316ac ("x86/topology: Handle bogus ACPI tables correctly")
Reported-by: Niels Dettenbach <nd@syndicat.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/x86/xen/enlighten_pv.c

index 2c12ae42dc8bd991e9b8b618233e9b98ba63b611..d6818c6cafda1612bfe404235772555f14d67780 100644 (file)
@@ -1032,6 +1032,10 @@ static u64 xen_do_read_msr(unsigned int msr, int *err)
        switch (msr) {
        case MSR_IA32_APICBASE:
                val &= ~X2APIC_ENABLE;
+               if (smp_processor_id() == 0)
+                       val |= MSR_IA32_APICBASE_BSP;
+               else
+                       val &= ~MSR_IA32_APICBASE_BSP;
                break;
        }
        return val;