qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v7 11/16] hw/arm/virt: add support for VFIO devices


From: Eric Auger
Subject: [Qemu-devel] [PATCH v7 11/16] hw/arm/virt: add support for VFIO devices
Date: Fri, 31 Oct 2014 14:05:45 +0000

VFIO devices are dynamic sysbus devices. They could already be
instantiated. However for them to be functional, IRQ injection must
be programmed and started. This programming must happen after the
sysbus devices are attached to the platform bus and IRQ are bound.
Only at that time the GSI they are connected to are identified and
irqfd can be programmed.

Binding happens in a machine init done notifier registered by the
platform bus init. The IRQ start is done in another notifier that
must be registered before the platform bus creation.

This patchs adds the registration of the IRQ start notifier in machvirt.

Signed-off-by: Eric Auger <address@hidden>

---

The registration of the IRQ start notifier could also happen in
the platform bus.
---
 hw/arm/virt.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 3a09d58..911dbfc 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -44,6 +44,7 @@
 #include "qemu/error-report.h"
 #include "hw/arm/sysbus-fdt.h"
 #include "hw/platform-bus.h"
+#include "hw/vfio/vfio-platform.h"
 
 #define NUM_VIRTIO_TRANSPORTS 32
 
@@ -546,6 +547,14 @@ static void create_platform_bus(VirtBoardInfo *vbi, 
qemu_irq *pic,
     MemoryRegion *sysmem = get_system_memory();
 
     /*
+     * Registers a notifier that starts VFIO IRQ injection. The notifier
+     * must be registered before the platform bus device creation. This
+     * latter registers another notifier that binds the dynamic sysbus
+     * devices to the platform bus.
+     */
+    vfio_register_irq_starter(system_params->platform_bus_first_irq);
+
+    /*
      * register the notifier that will update the device tree with
      * the platform bus and device tree nodes. Must be done before
      * the instantiation of the platform bus device that registers
-- 
1.8.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]