From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH 2/2] fix compilation with kvm disabled Date: Thu, 9 Jul 2009 15:57:33 +0300 Message-ID: <20090709125733.GB26565@redhat.com> References: <1246991791-21741-1-git-send-email-glommer@redhat.com> <1246991791-21741-2-git-send-email-glommer@redhat.com> <1246991791-21741-3-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, avi@redhat.com To: Glauber Costa Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39358 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760773AbZGIM6S (ORCPT ); Thu, 9 Jul 2009 08:58:18 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n69CwH8m014856 for ; Thu, 9 Jul 2009 08:58:17 -0400 Content-Disposition: inline In-Reply-To: <1246991791-21741-3-git-send-email-glommer@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jul 07, 2009 at 02:36:31PM -0400, Glauber Costa wrote: > Signed-off-by: Glauber Costa > --- > hw/msix.c | 14 ++++++++++++++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/hw/msix.c b/hw/msix.c > index b6f3948..8636f69 100644 > --- a/hw/msix.c > +++ b/hw/msix.c > @@ -63,6 +63,7 @@ > /* Flag for interrupt controller to declare MSI-X support */ > int msix_supported; > > +#ifdef USE_KVM > /* KVM specific MSIX helpers */ > static void kvm_msix_free(PCIDevice *dev) > { > @@ -157,6 +158,14 @@ static void kvm_msix_del(PCIDevice *dev, unsigned vector) > kvm_del_routing_entry(kvm_context, &dev->msix_irq_entries[vector]); > kvm_commit_irq_routes(kvm_context); > } > +#else > + > +static void kvm_msix_free(PCIDevice *dev) {} > +static void kvm_msix_update(PCIDevice *dev, int vector, > + int was_masked, int is_masked) {} > +static int kvm_msix_add(PCIDevice *dev, unsigned vector) { return -1; } > +static void kvm_msix_del(PCIDevice *dev, unsigned vector) {} > +#endif > > /* Add MSI-X capability to the config space for the device. */ > /* Given a bar and its size, add MSI-X table on top of it Avi, let's apply this first bit so that people can build with kvm-disabled, and think a bit about the second one? > @@ -337,10 +346,12 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries, > if (nentries > MSIX_MAX_ENTRIES) > return -EINVAL; > > +#ifdef KVM_CAP_IRQCHIP > if (kvm_enabled() && qemu_kvm_irqchip_in_kernel()) { > dev->msix_irq_entries = qemu_malloc(nentries * > sizeof *dev->msix_irq_entries); > } > +#endif > dev->msix_entry_used = qemu_mallocz(MSIX_MAX_ENTRIES * > sizeof *dev->msix_entry_used); > > @@ -454,10 +465,13 @@ void msix_notify(PCIDevice *dev, unsigned vector) > msix_set_pending(dev, vector); > return; > } > + > +#ifdef KVM_CAP_IRQCHIP > if (kvm_enabled() && qemu_kvm_irqchip_in_kernel()) { > kvm_set_irq(dev->msix_irq_entries[vector].gsi, 1, NULL); > return; > } > +#endif > > address = pci_get_long(table_entry + MSIX_MSG_UPPER_ADDR); > address = (address << 32) | pci_get_long(table_entry + MSIX_MSG_ADDR); > -- > 1.6.2.2 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html