Page MenuHomeFreeBSD

iommu_gas: Eliminate redundant parameters and push down lock acquisition

Authored by alc on Fri, Jul 29, 5:50 PM.



Since IOMMU map entries store a reference to the domain in which they reside, there is no need to pass the domain to iommu_gas_free_entry(), iommu_gas_free_space(), and iommu_gas_free_region().

Push down the acquisition and release of the IOMMU domain lock into iommu_gas_free_space() and iommu_gas_free_region().

Both of these changes allow for simplifications in the callers of the functions without really complicating the functions themselves. Moreover, the latter change eliminates the direct use of the IOMMU domain lock from the x86-specific DMAR code.

Diff Detail

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alc requested review of this revision.Fri, Jul 29, 5:50 PM
This revision is now accepted and ready to land.Fri, Jul 29, 7:06 PM

Since callers to iommu_gas_map_region() provide the entry, assert that the entry was actually allocated for the domain in which the mapping is about to be created.

This revision now requires review to proceed.Sat, Jul 30, 6:43 PM
This revision is now accepted and ready to land.Sat, Jul 30, 7:04 PM