On 2021/12/6 19:56, Joerg Roedel wrote: > On Tue, Nov 16, 2021 at 05:06:20PM +0800, Yicong Yang wrote: >> Export iommu_{get,put}_resv_regions() to the modules so that the driver >> can retrieve and use the reserved regions of the device. > > Why should any driver bother? These functions are only used by the iommu > core to call into iommu drivers to get information about needed direct > mappings. Why drivers need this information belongs into this commit > message. > Our driver makes use of RMR[1], so we need these APIs to retrieve the reserved memory region in the driver. The device will store the traced data to the rmr memory and the drivers needs to know the memory address for reading the data. Due to some hardware limitation, the device can only use direct mapping for DMA so we need RMR when the iommu is presented and the policy of the iommu domain is not passthrough. [1] https://lore.kernel.org/linux-acpi/20210805080724.480-1-shameerali.kolothum.thodi@xxxxxxxxxx/ Thanks, Yicong