[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aV57jZiKBfDHXciP@google.com>
Date: Wed, 7 Jan 2026 15:28:13 +0000
From: Pranjal Shrivastava <praan@...gle.com>
To: Mostafa Saleh <smostafa@...gle.com>
Cc: linux-mm@...ck.org, iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, corbet@....net, joro@...tes.org,
will@...nel.org, robin.murphy@....com, akpm@...ux-foundation.org,
vbabka@...e.cz, surenb@...gle.com, mhocko@...e.com,
jackmanb@...gle.com, hannes@...xchg.org, ziy@...dia.com,
david@...hat.com, lorenzo.stoakes@...cle.com,
Liam.Howlett@...cle.com, rppt@...nel.org, xiaqinxin@...wei.com,
baolu.lu@...ux.intel.com, rdunlap@...radead.org
Subject: Re: [PATCH v5 2/4] iommu: Add calls for IOMMU_DEBUG_PAGEALLOC
On Tue, Jan 06, 2026 at 04:21:58PM +0000, 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@...gle.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: Pranjal Shrivastava <praan@...gle.com>
Thanks
Powered by blists - more mailing lists