From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 8/8] KVM: Merge MSI handling to kvm_set_irq Date: Wed, 24 Dec 2008 10:44:56 +0800 Message-ID: <200812241044.57237.sheng@linux.intel.com> References: <1230019231-16543-1-git-send-email-sheng@linux.intel.com> <1230019231-16543-9-git-send-email-sheng@linux.intel.com> <20081223181020.GD5449@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, Xiantao Zhang To: Marcelo Tosatti Return-path: Received: from mga09.intel.com ([134.134.136.24]:60823 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbYLXCpQ (ORCPT ); Tue, 23 Dec 2008 21:45:16 -0500 In-Reply-To: <20081223181020.GD5449@amt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Wednesday 24 December 2008 02:10:20 Marcelo Tosatti wrote: > On Tue, Dec 23, 2008 at 04:00:31PM +0800, Sheng Yang wrote: > > Using kvm_set_irq to handle all interrupt injection. > > > > Signed-off-by: Sheng Yang > > --- > > include/linux/kvm_host.h | 2 +- > > virt/kvm/irq_comm.c | 96 > > ++++++++++++++++++++++++++++++++++++++------- virt/kvm/kvm_main.c | > > 75 +++--------------------------------- 3 files changed, 88 > > insertions(+), 85 deletions(-) > > > > --- a/virt/kvm/irq_comm.c > > +++ b/virt/kvm/irq_comm.c > > @@ -20,28 +20,94 @@ > > */ > > > > > > #ifdef CONFIG_X86 > > - kvm_pic_set_irq(pic_irqchip(kvm), irq, !!(*irq_state)); > > + gsi_msg = kvm_find_gsi_msg(kvm, gsi); > > It was nicer isolated in assigned_device_msi_dispatch. Um... The gsi_msg layer existed for this... AD: No matter it's MSI, MSI-X or IOAPIC, do kvm_set_irq() simply, you would get a interrupt! :) > > > -#ifdef CONFIG_X86 > > -#include > > -#endif > > And there's quite some x86 specific code sneaking into virt/kvm. Ideally > platform specific parts should be hidden behind interfaces. Sorry for the #ifdef, we would discard it after we enable MSI for IA64 which share the code mostly. -- regards Yang, Sheng