From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yang Zhang Subject: [PATCH v5 0/6] Use eoi to track RTC interrupt delivery status Date: Thu, 21 Mar 2013 18:49:18 +0800 Message-ID: <1363862964-25148-1-git-send-email-yang.z.zhang@intel.com> Cc: gleb@redhat.com, mtosatti@redhat.com, xiantao.zhang@intel.com, Yang Zhang To: kvm@vger.kernel.org Return-path: Received: from mga03.intel.com ([143.182.124.21]:36208 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251Ab3CUKxe (ORCPT ); Thu, 21 Mar 2013 06:53:34 -0400 Sender: kvm-owner@vger.kernel.org List-ID: From: Yang Zhang 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 pending_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 v4 to v5 * Calculate destination vcpu on interrupt injection not hook into ioapic modification. * Rebase on top of KVM. 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 (6): KVM: Add vcpu info to ioapic_update_eoi() KVM: Introduce struct rtc_status KVM : Return destination vcpu on interrupt injection KVM: Add reset/restore rtc_status support KVM : Force vmexit with virtual interrupt delivery KVM: Use eoi to track RTC interrupt delivery status arch/x86/kvm/lapic.c | 31 ++++++++++++--- arch/x86/kvm/lapic.h | 7 ++- virt/kvm/ioapic.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++---- virt/kvm/ioapic.h | 13 +++++- virt/kvm/irq_comm.c | 12 +++--- 5 files changed, 142 insertions(+), 24 deletions(-)