x86/vmx: always sync PIR to IRR before vmentry
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 28 Nov 2019 10:58:25 +0000 (11:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 28 Nov 2019 10:58:25 +0000 (11:58 +0100)
commit56348df32bbc782e63b6e3fb978b80e015ae76e7
treed3260ea9aee7730158bc714b4687da00aab54e0b
parent9a400d1797ec7f77ffefeb5c4e17a8c2e8b91a12
x86/vmx: always sync PIR to IRR before vmentry

When using posted interrupts on Intel hardware it's possible that the
vCPU resumes execution with a stale local APIC IRR register because
depending on the interrupts to be injected vlapic_has_pending_irq
might not be called, and thus PIR won't be synced into IRR.

Fix this by making sure PIR is always synced to IRR in
hvm_vcpu_has_pending_irq regardless of what interrupts are pending.

Reported-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Joe Jin <joe.jin@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/hvm/irq.c
xen/arch/x86/hvm/vlapic.c
xen/include/asm-x86/hvm/vlapic.h