I've been browsing through the Linux IOMMU code for quite a while now and couldn't find an easy approach to directly create an IOMMU entry.
I want to specify the physical address (maybe also the virtual but it is not necessary) and the device. The range should be inserted into the IOMMU and the virt address printed through printk.
I am searching for a function that lets me easily do it.
Thanks
I ended up with a pretty hacky solution, not the optimal one, but it worked for my usecase. Adjusted the function
iommu_dma_map_pageindma-iommu.cto look like the following and export it.(vanilla 5.18 except for this modification)
Then use the following kernel module to program the entry. This could be also extended and programmed in a more usable manner, but for prototyping, it should be enough.