[vfio-users] VFIO for PCIe streaming from/to user space

Alex Williamson alex.williamson at redhat.com
Tue Jan 30 15:06:40 UTC 2018


On Tue, 30 Jan 2018 12:02:32 +0100
Oliver Heid <Oliver.Heid at h-next.de> wrote:

> Hi,
> I want to user VFIO for direct streaming between user space and a PCIe 
> device (FPGA). Device isolation works, but how do I re-assign the PCIe 
> BARs to my user space memory and handle the IOMMU TLB remapping? Or is 
> there some other/better way to do that?

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/vfio.txt

PCI BARs are exposed as regions within the device file descriptor, you
can read/write to them via the file descriptor or mmap them into the
user address space where supported.  DMA is configured via ioctls on
the container, mapping a user virtual address to an IOVA.  Note that
some IOMMUs do not support a full 64bit IOVA space, so don't expect to
be able to identity map the IOVA to the virtual address.  We're working
on an API to expose to the IOVA ranges to userspace.  Thanks,

Alex




More information about the vfio-users mailing list