Thread (23 messages) 23 messages, 5 authors, 2026-01-09

Re: [PATCH v5 2/4] iommu: Add calls for IOMMU_DEBUG_PAGEALLOC

From: Baolu Lu <baolu.lu@linux.intel.com>
Date: 2026-01-07 05:48:23
Also in: linux-iommu, linux-mm, lkml

On 1/7/26 00:21, Mostafa Saleh wrote:
Add calls for the new iommu debug config IOMMU_DEBUG_PAGEALLOC:
- iommu_debug_init: Enable the debug mode if configured by the user.
- iommu_debug_map: Track iommu pages mapped, using physical address.
- iommu_debug_unmap_begin: Track start of iommu unmap operation, with
   IOVA and size.
- iommu_debug_unmap_end: Track the end of unmap operation, passing the
   actual unmapped size versus the tracked one at unmap_begin.

We have to do the unmap_begin/end as once pages are unmapped we lose
the information of the physical address.
This is racy, but the API is racy by construction as it uses refcounts
and doesn't attempt to lock/synchronize with the IOMMU API as that will
be costly, meaning that possibility of false negative exists.

Signed-off-by: Mostafa Saleh<smostafa@google.com>
---
  drivers/iommu/iommu-debug-pagealloc.c | 28 +++++++++++++
  drivers/iommu/iommu-priv.h            | 58 +++++++++++++++++++++++++++
  drivers/iommu/iommu.c                 | 11 ++++-
  include/linux/iommu-debug-pagealloc.h |  1 +
  4 files changed, 96 insertions(+), 2 deletions(-)
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help