x86/apic: do not initialize LDR and DFR for bigsmp
authorBandan Das <bsd@redhat.com>
Fri, 6 Sep 2019 15:07:55 +0000 (17:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Sep 2019 15:07:55 +0000 (17:07 +0200)
commit71946aa528edaff5ea5e1a2ba6f4d462b9623efe
treecd27c68f865e813c24db44c4a00f2256d05e9487
parent12a416837716922e0384a92bacfd8bc62a6409af
x86/apic: do not initialize LDR and DFR for bigsmp

Legacy apic init uses bigsmp for smp systems with 8 and more CPUs. The
bigsmp APIC implementation uses physical destination mode, but it
nevertheless initializes LDR and DFR. The LDR even ends up incorrectly with
multiple bit being set.

This does not cause a functional problem because LDR and DFR are ignored
when physical destination mode is active, but it triggered a problem on a
32-bit KVM guest which jumps into a kdump kernel.

The multiple bits set unearthed a bug in the KVM APIC implementation. The
code which creates the logical destination map for VCPUs ignores the
disabled state of the APIC and ends up overwriting an existing valid entry
and as a result, APIC calibration hangs in the guest during kdump
initialization.

Remove the bogus LDR/DFR initialization.

This is not intended to work around the KVM APIC bug. The LDR/DFR
ininitalization is wrong on its own.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Bandan Das <bsd@redhat.com>
[Linux commit bae3a8d3308ee69a7dbdf145911b18dfda8ade0d]

Drop init_apic_ldr_x2apic_phys() at the same time.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/genapic/delivery.c
xen/arch/x86/genapic/x2apic.c