]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: lapic: Fixup LDR on load in x2apic
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 17 Nov 2017 11:52:50 +0000 (11:52 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Nov 2017 16:32:53 +0000 (17:32 +0100)
commit12806ba937382fdfdbad62a399aa2dce65c10fcd
tree20498528e5a025aedf97ef2728259b054368ee90
parente872fa94662d0644057c7c80b3071bdb9249e5ab
KVM: lapic: Fixup LDR on load in x2apic

In x2apic mode the LDR is fixed based on the ID rather
than separately loadable like it was before x2.
When kvm_apic_set_state is called, the base is set, and if
it has the X2APIC_ENABLE flag set then the LDR is calculated;
however that value gets overwritten by the memcpy a few lines
below overwriting it with the value that came from userland.

The symptom is a lack of EOI after loading the state
(e.g. after a QEMU migration) and is due to the EOI bitmap
being wrong due to the incorrect LDR.  This was seen with
a Win2016 guest under Qemu with irqchip=split whose USB mouse
didn't work after a VM migration.

This corresponds to RH bug:
  https://bugzilla.redhat.com/show_bug.cgi?id=1502591

Reported-by: Yiqian Wei <yiwei@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: stable@vger.kernel.org
[Applied fixup from Liran Alon. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c