From: Yang Zhang <yang.z.zhang@xxxxxxxxx> Current interrupt coalescing logci which only used by RTC has conflict with Posted Interrupt. This patch introduces a new mechinism to use eoi to track interrupt: When delivering an interrupt to vcpu, the need_eoi set to number of vcpu that received the interrupt. And decrease it when each vcpu writing eoi. No subsequent RTC interrupt can deliver to vcpu until all vcpus write eoi. Changes from v3 to v4 * Call kvm_apic_match_dest() to check destination vcpu. * Update RTC interrrupt's destination vcpu map when ioapic entry of RTC or apic register (id, ldr, dfr) is changed. Changes from v2 to v3: * Remove unused viarable irq_ack_notifier. * Acquire ioapic->lock before calculte destination vcpu map. * Copy vcpu_map to expected_eoi_timap on each RTC irq and clear it on eoi. Yang Zhang (7): KVM: Call kvm_apic_match_dest() to check destination vcpu KVM: Call common update function when ioapic entry changed. KVM: Add vcpu info to ioapic_update_eoi() KVM: Introduce struct rtc_status KVM: Recalculate destination vcpu map KVM: Add reset/restore rtc_status support KVM: Use eoi to track RTC interrupt delivery status arch/ia64/kvm/lapic.h | 6 -- arch/x86/kvm/lapic.c | 59 +++--------------- arch/x86/kvm/lapic.h | 4 +- arch/x86/kvm/vmx.c | 3 + arch/x86/kvm/x86.c | 11 ++- include/linux/kvm_host.h | 4 +- virt/kvm/ioapic.c | 152 ++++++++++++++++++++++++++++++++++++++++------ virt/kvm/ioapic.h | 19 ++++-- virt/kvm/irq_comm.c | 4 +- virt/kvm/kvm_main.c | 4 +- 10 files changed, 175 insertions(+), 91 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html