x86/apic: include the LDR when clearing out APIC registers
authorBandan Das <bsd@redhat.com>
Fri, 6 Sep 2019 15:07:14 +0000 (17:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Sep 2019 15:07:14 +0000 (17:07 +0200)
commit12a416837716922e0384a92bacfd8bc62a6409af
tree6170f6995067c5d073f94992601a473121601fe0
parentfef9e95ee1b9be733dd3e19b99703f4f05fb740e
x86/apic: include the LDR when clearing out APIC registers

Although APIC initialization will typically clear out the LDR before
setting it, the APIC cleanup code should reset the LDR.

This was discovered with a 32-bit KVM guest jumping into a kdump
kernel. The stale bits in the LDR triggered a bug in the KVM APIC
implementation which caused the destination mapping for VCPUs to be
corrupted.

Note that this isn't intended to paper over the KVM APIC bug. The kernel
has to clear the LDR when resetting the APIC registers except when X2APIC
is enabled.

Signed-off-by: Bandan Das <bsd@redhat.com>
[Linux commit 558682b5291937a70748d36fd9ba757fb25b99ae]
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/apic.c