From patchwork Tue Jul 7 18:36:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 34506 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 n67IaefX031548 for ; Tue, 7 Jul 2009 18:36:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754253AbZGGSgg (ORCPT ); Tue, 7 Jul 2009 14:36:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754146AbZGGSgf (ORCPT ); Tue, 7 Jul 2009 14:36:35 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42288 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754175AbZGGSge (ORCPT ); Tue, 7 Jul 2009 14:36:34 -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 n67IaXLR024022 for ; Tue, 7 Jul 2009 14:36:33 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n67IaW7u021831; Tue, 7 Jul 2009 14:36:33 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n67IaVqC026175; Tue, 7 Jul 2009 14:36:32 -0400 From: Glauber Costa To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH 2/2] fix compilation with kvm disabled Date: Tue, 7 Jul 2009 14:36:31 -0400 Message-Id: <1246991791-21741-3-git-send-email-glommer@redhat.com> In-Reply-To: <1246991791-21741-2-git-send-email-glommer@redhat.com> References: <1246991791-21741-1-git-send-email-glommer@redhat.com> <1246991791-21741-2-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 @@ -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);