To allow DMA from within the driver VMs we need to allow read/write from linux userspace directly. The virtualiser passes a physical address to DMA into/from, and we wish to create a mapping in linux to this physical address to interact with. Linux does not seem to provide that option. The uio memory mappings we've been using so far are special mappings with VM_IO / VM_PFNMAP flag set in the VMA that fails direct I/O validations. The culprit seems to be remap_pfn_range, which marks the range of addresses as VM_IO. The same issue occurs when trying to mmap /dev/mem. For now all DMAable devices still require an extra copy.
To allow DMA from within the driver VMs we need to allow read/write from linux userspace directly. The virtualiser passes a physical address to DMA into/from, and we wish to create a mapping in linux to this physical address to interact with. Linux does not seem to provide that option. The uio memory mappings we've been using so far are special mappings with
VM_IO
/VM_PFNMAP
flag set in the VMA that fails direct I/O validations. The culprit seems to beremap_pfn_range
, which marks the range of addresses asVM_IO
. The same issue occurs when trying to mmap /dev/mem. For now all DMAable devices still require an extra copy.