]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu: debug-pagealloc: Track IOMMU pages
authorMostafa Saleh <smostafa@google.com>
Fri, 9 Jan 2026 17:18:04 +0000 (17:18 +0000)
committerJoerg Roedel <joerg.roedel@amd.com>
Sat, 10 Jan 2026 09:52:27 +0000 (10:52 +0100)
commit7e84593795b3c05ca682b8aa74cceeceae636ec7
tree42b3d844740a44d16728aa255e6572a0044591f6
parentccc21213f013834b484cdcc738e282f963fcfc97
iommu: debug-pagealloc: Track IOMMU pages

Using the new calls, use an atomic refcount to track how many times
a page is mapped in any of the IOMMUs.

For unmap we need to use iova_to_phys() to get the physical address
of the pages.

We use the smallest supported page size as the granularity of tracking
per domain.
This is important as it is possible to map pages and unmap them with
larger sizes (as in map_sg()) cases.

Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/iommu-debug-pagealloc.c