All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: [PATCH] msix: fix irqchip breakage
Date: Wed, 20 Oct 2010 07:09:37 +0200	[thread overview]
Message-ID: <20101020050937.GA10401@redhat.com> (raw)

msix.c doesn't include linux kvm header anymore, so
IRQCHIP macro is never defined, which resulted in
a broken msix support. As a fix, stub out kvm_set_irq
and remove the remaining ifdefs.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/msix.c  |    2 --
 kvm-stub.c |    6 ++++++
 kvm.h      |    2 ++
 qemu-kvm.h |    1 -
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/hw/msix.c b/hw/msix.c
index f12e4aa..4b6133d 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -509,12 +509,10 @@ void msix_notify(PCIDevice *dev, unsigned vector)
         return;
     }
 
-#ifdef KVM_CAP_IRQCHIP
     if (kvm_enabled() && 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);
diff --git a/kvm-stub.c b/kvm-stub.c
index 3c2deec..aeee3c0 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -176,3 +176,9 @@ int kvm_commit_irq_routes(void)
 {
     return -ENOSYS;
 }
+
+int kvm_set_irq(int irq, int level, int *status)
+{
+    assert(0);
+    return -ENOSYS;
+}
diff --git a/kvm.h b/kvm.h
index d484a3f..74dfa48 100644
--- a/kvm.h
+++ b/kvm.h
@@ -214,4 +214,6 @@ int kvm_commit_irq_routes(void);
 
 int kvm_irqchip_in_kernel(void);
 
+int kvm_set_irq(int irq, int level, int *status);
+
 #endif
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 9c08ab4..c6f5632 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -785,7 +785,6 @@ void kvm_load_lapic(CPUState *env);
 
 void kvm_hpet_enable_kpit(void);
 void kvm_hpet_disable_kpit(void);
-int kvm_set_irq(int irq, int level, int *status);
 
 int kvm_physical_memory_set_dirty_tracking(int enable);
 
-- 
1.7.3-rc1

             reply	other threads:[~2010-10-20  5:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20  5:09 Michael S. Tsirkin [this message]
2010-10-20 17:37 ` [PATCH] msix: fix irqchip breakage Marcelo Tosatti

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=20101020050937.GA10401@redhat.com \
    --to=mst@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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.