Hi All I am working on the concept of accelerator-initiated IO [1] and have been exploring doing this inside a VM using real accelerators and emulated target devices (mostly emulated NVMe). In order for the accelerator to be able to write to the MMIO doorbell of an emulated NVMe SSD I thinkĀ I need to create an IOVA mapping for that region of the emulated NVMe's BAR0 in the host's IOMMU. I can hack this into QEMU but I was wondering if there is already a way to do this or if anyone has ideas on how best to do this in an upstream-able fashion.
I am happy to share my hacky patch if that helps. It adds a vendor-specific NVMe admin command that creates the mapping under the hood and (optionally) returns the mapping to the guest to pass into the accelerator program code. Cheers Stephen [1]: https://lwn.net/Articles/1022718/
