Re: [PATCH v5 3/4] iommu: debug-pagealloc: Track IOMMU pages
From: Baolu Lu
Date: Thu Jan 08 2026 - 22:28:31 EST
On 1/8/26 19:33, Mostafa Saleh wrote:
I have this, it should have the same effect + a WARN, I will include
it in the new version
diff --git a/drivers/iommu/iommu-debug-pagealloc.c
b/drivers/iommu/iommu-debug-pagealloc.c
index 5353417e64f9..64ec0795fe4c 100644
--- a/drivers/iommu/iommu-debug-pagealloc.c
+++ b/drivers/iommu/iommu-debug-pagealloc.c
@@ -146,16 +146,12 @@ void __iommu_debug_unmap_end(struct iommu_domain *domain,
if (unmapped == size)
return;
- /*
- * If unmap failed, re-increment the refcount, but if it unmapped
- * larger size, decrement the extra part.
- */
+ /* If unmap failed, re-increment the refcount. */
if (unmapped < size)
__iommu_debug_update_iova(domain, iova + unmapped,
size - unmapped, true);
else
- __iommu_debug_update_iova(domain, iova + size,
- unmapped - size, false);
+ WARN_ONCE(1, "iommu: unmap larger than requested is
not supported in debug_pagealloc\n");
}
void iommu_debug_init(void)
How aobut
if ((unmapped == size) || WARN_ON_ONCE(unmapped > size))
return;
/* If unmap failed, re-increment the refcount. */
__iommu_debug_update_iova(domain, iova + unmapped, size - unmapped, true);
?
Thanks,
baolu