Re: [PATCH v5 1/4] iommu: Add page_ext for IOMMU_DEBUG_PAGEALLOC

From: Pranjal Shrivastava

Date: Wed Jan 07 2026 - 10:26:15 EST


On Tue, Jan 06, 2026 at 04:21:57PM +0000, Mostafa Saleh wrote:
> Add a new config IOMMU_DEBUG_PAGEALLOC, which registers new data to
> page_ext.
>
> This config will be used by the IOMMU API to track pages mapped in
> the IOMMU to catch drivers trying to free kernel memory that they
> still map in their domains, causing all types of memory corruption.
>
> This behaviour is disabled by default and can be enabled using
> kernel cmdline iommu.debug_pagealloc.
>
> Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Signed-off-by: Mostafa Saleh <smostafa@xxxxxxxxxx>
> ---
> .../admin-guide/kernel-parameters.txt | 9 ++++++
> drivers/iommu/Kconfig | 19 +++++++++++
> drivers/iommu/Makefile | 1 +
> drivers/iommu/iommu-debug-pagealloc.c | 32 +++++++++++++++++++
> include/linux/iommu-debug-pagealloc.h | 17 ++++++++++
> mm/page_ext.c | 4 +++
> 6 files changed, 82 insertions(+)
> create mode 100644 drivers/iommu/iommu-debug-pagealloc.c
> create mode 100644 include/linux/iommu-debug-pagealloc.h
>

Reviewed-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
Thanks!