On Wed, 28 Jan 2026 at 12:49, Viresh Kumar viresh.kumar@linaro.org wrote
We can pass the share-type from userspace and that can reach up to vsock / dma-buf (with minor API change to dma_buf_map_attachment_unlocked()) / system-heap.
But after that the standard dma_map_sgtable() call takes only one configurable parameter, `attributes` (which is set to 0 for now by system heap). There is nothing else which I can use to pass the flag to FFA specific DMA OPs.
I thought maybe I can create a new DMA attribute: `DMA_ATTR_MEM_LEND`, which can be passed in the `attr` field and that will work I guess.
But I am not sure if it would be acceptable upstream to add a new attribute for this.
If I understand you correctly, I think you need a dmabuf object that is mapped neither into the kernel nor into userspace, and to me that sounds like you should not be using the system heap for that, since that remains mapped into the kernel and is accessible from userspace as well.
The dma_map_sgtable() call in turn does not have to know about LEND vs SHARE, as all it does is map the memory into a bus address that can be shared with the firmware.
Arnd