On Mon, Mar 17, 2025 at 01:29:05PM +0800, Bingbu Cao wrote:I don't think it's a good idea to hack the common API, the WARN_ON() >> is really a mandatory check, and current case is a good example.
Why not update udmabuf to make it work with both vmap_pfns() and >> vmap()? As only the udmabuf knows it is actually working on? >> >>
What non-page backed memory does udmabuf try to work on, and moreIt's HUGETLB which enabled VMEMMAP_OPTIMIZE, all tail page's struct will
importantly how does it actually work on them given that the normaludmabuf's sg_table ref only folio+offset, no any page struct ref.
DMA APIs require page backed memory. Or is this just made it up
and it doesn't work at all given that it also tries to dma mapThis implement map_dma_buf&mmap&vmap&begin/end_cpu_access.
to the fake miscdevice struct device which can't work for most
cases?
Mapping non-page memory is difficult and without having coherent theory
of what non-page memory you are mapping and being very careful you
are extremely unlikely to get it right.