This patch aims at optimizing IRQ handling using irqfd framework.
It brings significant performance improvement over "traditional" IRQ
handling introduced in :
"vfio: Add initial IRQ support in platform device".
This new IRQ handling method depends on kernel KVM irqfd/GSI routing
capability.
The IRQ handling method can be dynamically chosen (default is irqfd,
if kernel supports it obviously). For example to disable irqfd
handling, use:
-device vfio-platform,vfio_device="fff51000.ethernet",\
compat="calxeda/hb-xgmac",mmap-timeout-ms=110,irqfd=false\
Performances are improved for the following reasons:
- eventfds signalled by the VFIO platform driver are handled on
kernel side by the KVM irqfd framework.
- the end of interrupt(EOI) is trapped at GIC level and not at MMIO
region level. As a reminder, in traditional IRQ handling QEMU
assumed the first guest access to a device MMIO region after IRQ
hit was the IRQ status register reset. This trap was approximate
and obliged to swap to slow path after IRQ hit. A mmap timer
mechanism enabled to swap back to fast path after the mmap period
introducing extra complexity. Now GIC detects the completion of
the virtual IRQ and signals a resampler eventfd on maintenance
IRQ. The corresponding handler re-enables the physical IRQ.