Overview ======== Using the host system's IOMMU and Qemu's VFIO interface enables the developer to use their own Linux host system to develop for and more importantly test device drivers on Genode without the need to use a different test system and running Genode on bare-metal. Configuration ============= * kernel cmdline: intel_iommu=on iommu=pt * check /sys/kernel/iommu_groups for dev (0000:bb:dd.f) * bind *every* device in IOMMU group to vfio-pci vendor=$(< /sys/bus/pci/devices/$dev/vendor) device=$(< /sys/bus/pci/devices/$dev/device) if [ -e /sys/bus/pci/devices/$dev/driver ]; then echo $dev > /sys/bus/pci/devices/$dev/driver/unbind fi echo $vendor $device > /sys/bus/pci/drivers/vfio-pci/new_id (if necessary and possible change PCIe slot to switch group or use the usual ACS magic) * change the Qemu arguments in the run script, e.g.: append qemu_args " -mem-prealloc -device vfio-pci,host=bb:dd.f " * adjust system permissions so that the qemu user may map DMA memory or be lazy and use 'sudo' Results ======= This approach was successfully tested with the following PCIe devices: * Asus Xonar DGX [13f6:8788] * Corsair MP500 [1987:5007] (rev 01) * Samsung 950 PRO [144d:a802] (rev 01) * Samsung 960 EVO [144d:a804] * Toshiba XG4 [1179:0115] (rev 01)