All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] pci: relax pci_msi_get_message()
@ 2016-11-22  7:48 Peter Xu
  2016-11-22  7:52 ` no-reply
  2016-11-22  7:58 ` no-reply
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Xu @ 2016-11-22  7:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: mst, peterx, david

We are very strict in the past getting MSIs from commit
d1f6af6a1 ("kvm-irqchip: simplify kvm_irqchip_add_msi_route"), assuming
that MSI should be configured before hand when fetching. When we have
unrecognized configurations, we panic the system. However looks like
this is too strict to be working on some platform, and issues occured.
Firstly it's found on a ppc case and fixed by David in:

  6d17a01 vfio/pci: Fix regression in MSI routing configuration

However we encountered another case now with windows virtio driver and
reported (and possibly more):

  http://bugs.debian.org/844361

To make every driver/hardware happy, let's loosen the rule and go back
to the original behavior - instead of panic the system, when we try to
fetch MSI without configured MSI/MSI-X system, we just provide an empty
message to make drivers happy.

Reported-by: Maciej Kotliński <makotlinski@gmail.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/pci/pci.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 24fae16..bda5211 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2606,9 +2606,11 @@ MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)
     } else if (msi_enabled(dev)) {
         msg = msi_get_message(dev, vector);
     } else {
-        /* Should never happen */
-        error_report("%s: unknown interrupt type", __func__);
-        abort();
+        /*
+         * Device is not configured with MSI/MSI-X yet, let's provide
+         * an empty message to make all device drivers happy.
+         */
+        bzero(&msg, sizeof(msg));
     }
     return msg;
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-22  8:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22  7:48 [Qemu-devel] [PATCH] pci: relax pci_msi_get_message() Peter Xu
2016-11-22  7:52 ` no-reply
2016-11-22  8:06   ` Peter Xu
2016-11-22  7:58 ` no-reply

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.