[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/38] ivshmem: Leave INTx alone when using MSI-X
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH 18/38] ivshmem: Leave INTx alone when using MSI-X |
Date: |
Mon, 29 Feb 2016 19:40:34 +0100 |
The ivshmem device can either use MSI-X or legacy INTx for interrupts.
With MSI-X enabled, peer interrupt events trigger an MSI as they
should. But software can still raise INTx via interrupt status and
mask register in BAR 0. This is explicitly prohibited by PCI Local
Bus Specification Revision 3.0, section 6.8.3.3:
While enabled for MSI or MSI-X operation, a function is prohibited
from using its INTx# pin (if implemented) to request service (MSI,
MSI-X, and INTx# are mutually exclusive).
Fix the device model to leave INTx alone when using MSI-X.
Document that we claim to use INTx in config space even when we don't.
Signed-off-by: Markus Armbruster <address@hidden>
---
hw/misc/ivshmem.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index cfea151..fc37feb 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -126,6 +126,11 @@ static void ivshmem_update_irq(IVShmemState *s)
PCIDevice *d = PCI_DEVICE(s);
uint32_t isr = s->intrstatus & s->intrmask;
+ /* No INTx with msi=off, whether the guest enabled MSI-X or not */
+ if (ivshmem_has_feature(s, IVSHMEM_MSI)) {
+ return;
+ }
+
/* don't print ISR resets */
if (isr) {
IVSHMEM_DPRINTF("Set IRQ to %d (%04x %04x)\n",
@@ -874,6 +879,10 @@ static void pci_ivshmem_realize(PCIDevice *dev, Error
**errp)
pci_conf = dev->config;
pci_conf[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY;
+ /*
+ * Note: we don't use INTx with IVSHMEM_MSI at all, so this is a
+ * bald-faced lie then. But it's a backwards compatible lie.
+ */
pci_config_set_interrupt_pin(pci_conf, 1);
memory_region_init_io(&s->ivshmem_mmio, OBJECT(s), &ivshmem_mmio_ops, s,
--
2.4.3
- [Qemu-devel] [PATCH 28/38] ivshmem: Tighten check of property "size", (continued)
- [Qemu-devel] [PATCH 28/38] ivshmem: Tighten check of property "size", Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 30/38] ivshmem: Simplify memory regions for BAR 2 (shared memory), Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 38/38] contrib/ivshmem-server: Print "not for production" warning, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 25/38] ivshmem: Rely on server sending the ID right after the version, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 04/38] tests/libqos/pci-pc: Fix qpci_pc_iomap() to map BARs aligned, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 08/38] ivshmem: Rewrite specification document, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 37/38] ivshmem: Require master to have ID zero, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 36/38] ivshmem: Drop ivshmem property x-memdev, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 24/38] ivshmem: Propagate errors through ivshmem_recv_setup(), Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 23/38] ivshmem: Receive shared memory synchronously in realize(), Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 18/38] ivshmem: Leave INTx alone when using MSI-X,
Markus Armbruster <=
- [Qemu-devel] [PATCH 31/38] ivshmem: Inline check_shm_size() into its only caller, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 35/38] ivshmem: Clean up after the previous commit, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 29/38] ivshmem: Implement shm=... with a memory backend, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 27/38] ivshmem: Simplify how we cope with short reads from server, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 17/38] ivshmem: Clean up MSI-X conditions, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 20/38] ivshmem: Simplify rejection of invalid peer ID from server, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 01/38] exec: Fix memory allocation when memory path names new file, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 33/38] ivshmem: Replace int role_val by OnOffAuto master, Markus Armbruster, 2016/02/29
- [Qemu-devel] [PATCH 34/38] ivshmem: Split ivshmem-plain, ivshmem-doorbell off ivshmem, Markus Armbruster, 2016/02/29