au-ts / libvmm

An experimental virtual machine monitor for the seL4 microkernel
Other
29 stars 15 forks source link

Driver VM Unable to DMA #99

Closed erichchan999 closed 3 months ago

erichchan999 commented 3 months ago

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.

Ivan-Velickovic commented 3 months ago

Maybe worth putting this in a comment under https://github.com/au-ts/libvmm/issues/97 instead of a new issue.

erichchan999 commented 3 months ago

Fair point, moved this over and will be closing this