Patchwork [2/2] pseries: enable irqfd for pci

login
register
mail settings
Submitter Alexey Kardashevskiy
Date Aug. 7, 2013, 8:51 a.m.
Message ID <1375865493-19143-3-git-send-email-aik@ozlabs.ru>
Download mbox | patch
Permalink /patch/265412/
State New
Headers show

Comments

Alexey Kardashevskiy - Aug. 7, 2013, 8:51 a.m.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/intc/xics_kvm.c | 5 +++++
 hw/ppc/spapr_pci.c | 6 ++++++
 2 files changed, 11 insertions(+)

Patch

diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index 1f078f3..9978a47 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -448,6 +448,11 @@  static void xics_kvm_realize(DeviceState *dev, Error **errp)
             goto fail;
         }
     }
+
+    kvm_kernel_irqchip = true;
+    kvm_irqfds_allowed = true;
+    kvm_msi_via_irqfd_allowed = true;
+
     return;
 
 fail:
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 6e14020..869ca43 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -457,6 +457,11 @@  static void spapr_msi_write(void *opaque, hwaddr addr,
     qemu_irq_pulse(xics_get_qirq(spapr->icp, irq));
 }
 
+static int spapr_pci_map_msi(KVMState *s, PCIBus *bus, MSIMessage msg)
+{
+    return msg.data;
+}
+
 static const MemoryRegionOps spapr_msi_ops = {
     /* There is no .read as the read result is undefined by PCI spec */
     .read = NULL,
@@ -631,6 +636,7 @@  static int spapr_phb_init(SysBusDevice *s)
 
         sphb->lsi_table[i].irq = irq;
     }
+    bus->map_msi = spapr_pci_map_msi;
 
     return 0;
 }