From patchwork Tue Jan 13 09:58:37 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 2106 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0D9svHN018123 for ; Tue, 13 Jan 2009 01:54:58 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752479AbZAMJ6w (ORCPT ); Tue, 13 Jan 2009 04:58:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755926AbZAMJ6w (ORCPT ); Tue, 13 Jan 2009 04:58:52 -0500 Received: from mga09.intel.com ([134.134.136.24]:42101 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbZAMJ6t (ORCPT ); Tue, 13 Jan 2009 04:58:49 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 13 Jan 2009 01:50:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.37,258,1231142400"; d="scan'208";a="377989750" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.176]) by orsmga002.jf.intel.com with ESMTP; 13 Jan 2009 01:57:11 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1LMg2j-0005t4-FG; Tue, 13 Jan 2009 17:58:41 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 3/7] KVM: Improve MSI dispatch function Date: Tue, 13 Jan 2009 17:58:37 +0800 Message-Id: <1231840721-22605-4-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1231840721-22605-1-git-send-email-sheng@linux.intel.com> References: <1231840721-22605-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Prepare to merge with kvm_set_irq(). Signed-off-by: Sheng Yang --- virt/kvm/kvm_main.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index f3d5958..b0b97ba 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -87,7 +87,7 @@ static bool kvm_rebooting; #ifdef KVM_CAP_DEVICE_ASSIGNMENT #ifdef CONFIG_X86 -static void assigned_device_msi_dispatch(struct kvm_assigned_dev_kernel *dev) +static void assigned_device_msi_dispatch(struct kvm_assigned_dev_kernel *dev, u32 gsi) { int vcpu_id; struct kvm_vcpu *vcpu; @@ -98,7 +98,7 @@ static void assigned_device_msi_dispatch(struct kvm_assigned_dev_kernel *dev) BUG_ON(!ioapic); - gsi_entry = kvm_find_gsi_route_entry(dev->kvm, dev->guest_irq); + gsi_entry = kvm_find_gsi_route_entry(dev->kvm, gsi); if (!gsi_entry) { printk(KERN_WARNING "kvm: fail to find correlated gsi entry\n"); return; @@ -145,7 +145,7 @@ static void assigned_device_msi_dispatch(struct kvm_assigned_dev_kernel *dev) } } #else -static void assigned_device_msi_dispatch(struct kvm_assigned_dev_kernel *dev) {} +static void assigned_device_msi_dispatch(struct kvm_assigned_dev_kernel *dev, u32 gsi) {} #endif static struct kvm_assigned_dev_kernel *kvm_find_assigned_dev(struct list_head *head, @@ -180,7 +180,7 @@ static void kvm_assigned_dev_interrupt_work_handler(struct work_struct *work) assigned_dev->guest_irq, 1); else if (assigned_dev->irq_requested_type & KVM_ASSIGNED_DEV_GUEST_MSI) { - assigned_device_msi_dispatch(assigned_dev); + assigned_device_msi_dispatch(assigned_dev, assigned_dev->guest_irq); enable_irq(assigned_dev->host_irq); assigned_dev->host_irq_disabled = false; }