From: "Michael S. Tsirkin" <mst@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: kvm@vger.kernel.org, avi@redhat.com
Subject: Re: [PATCH 2/2] fix compilation with kvm disabled
Date: Wed, 8 Jul 2009 10:59:13 +0300 [thread overview]
Message-ID: <20090708075913.GA12440@redhat.com> (raw)
In-Reply-To: <1246991791-21741-3-git-send-email-glommer@redhat.com>
On Tue, Jul 07, 2009 at 02:36:31PM -0400, Glauber Costa wrote:
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
> 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
Thanks for fix!
> @@ -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);
I think it's time we stopped worrying about builds against old kernel
headers or without them. What do we gain from it?
I believe that the right thing to do is to define kvm_enabled as a macro
returning 0, and let compiler optimize the code out.
Avi?
--
MST
next prev parent reply other threads:[~2009-07-08 7:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 18:36 [PATCH 0/2] Fix compilation with --disable-kvm Glauber Costa
2009-07-07 18:36 ` [PATCH 1/2] surround kvm function with kvm_enabled Glauber Costa
2009-07-07 18:36 ` [PATCH 2/2] fix compilation with kvm disabled Glauber Costa
2009-07-08 7:59 ` Michael S. Tsirkin [this message]
2009-07-08 12:09 ` Glauber Costa
2009-07-08 12:10 ` Avi Kivity
2009-07-08 12:11 ` Avi Kivity
2009-07-08 12:13 ` Michael S. Tsirkin
2009-07-08 12:20 ` Avi Kivity
2009-07-08 12:20 ` Michael S. Tsirkin
2009-07-09 12:57 ` Michael S. Tsirkin
2009-07-07 18:43 ` [PATCH 0/2] Fix compilation with --disable-kvm Jan Kiszka
2009-07-08 12:14 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090708075913.GA12440@redhat.com \
--to=mst@redhat.com \
--cc=avi@redhat.com \
--cc=glommer@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.