These patches are the next iteration of "[Qemu-devel] [RFC 0/4] AMBA platform device passthrough" and are based on the latest version of VFIO for platform devices "[RFC PATCH v5 00/11] VFIO support for platform devices" and the initial patch series "[Qemu-devel] [RFC v2 0/6] KVM platform device passthrough".
- [PATCH 1/4] Addition of the exec flag to the DMA mappings. At the moment this is mandatory only for the ARM SMMU. Change since v1: Thanks to the new version of the VFIO API, now we can know from the kernel if the IOMMU requires the EXEC_FLAG. For now, we always add it if supported. - [PATCH 2/4] Possibility to bind a wider class of devices. In particular the patch proposes a solution to enhance a bit the device tree nodes generation, allowing to specify more than one compatibility property (handy for AMBA devices). This was required by the DMA330 that needs "arm,pl330","arm,primecell" as compatibility string, together with a clock source defined in the device tree. In the future VFIO will be able to tell if we are dealing with an AMBA device; before that, we have to rely on the compatibility string to state that. - [PATCH 3/4] Another approach to handle the EOI, starting from the assumption that we know in advance the location of the interrupt clear register of the device. This is of course another workaround and not the definitive solution until we can rely on a proper callback from the VGIC (something that we will see in a future version of VFIO for platform devices). Change since v1: The code is much simpler now and does not require the definition of an additional memory region which would be dma-mapped by the memory listener vfio_listener_region_add in hw/vfio/common.c. In this regard probably soon or later we will need a way to exclude some regions from being mapped "blindly" by the memory listener: this is for example what happens with the memory region of the device which is dma-mapped to itself. - [PATCH 4/4] If event_notifier_init fails to create a new eventfd, it will fallback usign pipe/pipe2 and we end up passing to the kernel a wrong file descriptor. This patch force to check if eventfd has been used. In order to easy the test of the VFIO API with platform devices, here: https://github.com/virtualopensystems/vfio-host-test.git is possible to find a handy test suite for an ARM host which will print the devices that could be probed with VFIO and run some basic tests on a chosen device. If the ARM DMA330 is tested, a device specific code (which was introduced in the Virtual Open Systems guide http://virtualopensystems.com/en/solutions/guides/vfio-on-arm) will be run to verify even further the correct behaviour of the device. This suite has been tested with ARM FastModels. Alvise Rigo (4): Add EXEC_FLAG to VFIO DMA mappings Add AMBA devices support to VFIO MemoryRegion with EOI callbacks for VFIO Platform devices Always use eventfd as notifying mechanism hw/arm/virt.c | 39 ++++++++++++++++--- hw/vfio/common.c | 9 +++++ hw/vfio/platform.c | 96 +++++++++++++++++++++++++++++++++++++++++++++- hw/vfio/vfio-common.h | 1 + linux-headers/linux/vfio.h | 2 + 5 files changed, 140 insertions(+), 7 deletions(-) -- 1.9.1