RE: [RFC v3 2/3] virtio: Introduce Vdmabuf driver
From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
Date: 2021-02-12 08:37:32
Also in:
dri-devel, linux-media
Hi Christian,
Hi Vivek,quoted
[Kasireddy, Vivek] What if I do mmap() on the fd followed by mlock() or mmap() followed by get_user_pages()? If it still fails, would ioremapping the device memory and poking at the backing storage be an option? Or, if I bind the passthrough'd GPU device to vfio-pci and tap into the memory region associated with the device memory, can it be made to work?get_user_pages() is not allowed on mmaped DMA-bufs in the first place. Daniel is currently adding code to make sure that this is never ever used.quoted
And, I noticed that for PFNs that do not have valid struct page associated with it, KVM does a memremap() to access/map them. Is this an option?No, even for system memory which has a valid struct page touching it when it is part of a DMA-buf is illegal since the reference count and mapping fields in struct page might be used for something different. Keep in mind that struct page is a heavily overloaded structure for different use cases. You can't just use it for a different use case than what the owner of the page has intended it.
[Kasireddy, Vivek] What is your recommended/acceptable way for doing what I am trying to do? Thanks, Vivek
Regards, Christian.quoted
Thanks, Vivekquoted
take care, Gerd
_______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization