x86/vlapic: clear TMR bit upon acceptance of edge-triggered interrupt to IRR
authorLiran Alon <liran.alon@oracle.com>
Thu, 15 Mar 2018 15:59:52 +0000 (16:59 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 15 Mar 2018 15:59:52 +0000 (16:59 +0100)
commit12a50030a81a14a3c7be672ddfde707b961479ec
tree2858408548051f9f078ba47dcebc9e3363d403f3
parentc0e34ba78aaec2e2b1aa2a810bc7b3ee1fdfcf3f
x86/vlapic: clear TMR bit upon acceptance of edge-triggered interrupt to IRR

According to Intel SDM section "Interrupt Acceptance for Fixed Interrupts":
"The trigger mode register (TMR) indicates the trigger mode of the
interrupt (see Figure 10-20). Upon acceptance of an interrupt
into the IRR, the corresponding TMR bit is cleared for
edge-triggered interrupts and set for level-triggered interrupts.
If a TMR bit is set when an EOI cycle for its corresponding
interrupt vector is generated, an EOI message is sent to
all I/O APICs."

Before this patch TMR-bit was cleared on LAPIC EOI which is not what
real hardware does. This was also confirmed in KVM upstream commit
a0c9a822bf37 ("KVM: dont clear TMR on EOI").

Behavior after this patch is aligned with both Intel SDM and KVM
implementation.

Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/vlapic.c