[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFgf54r76=RF0TAkJ42VDnRkwYf0=bjRk-pO1dq3zzvxGBThww@mail.gmail.com>
Date: Tue, 6 Jan 2026 15:49:48 +0000
From: Mostafa Saleh <smostafa@...gle.com>
To: Baolu Lu <baolu.lu@...ux.intel.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,
rdunlap@...radead.org
Subject: Re: [PATCH v4 1/4] iommu: Add page_ext for IOMMU_DEBUG_PAGEALLOC
On Fri, Dec 12, 2025 at 2:22 AM Baolu Lu <baolu.lu@...ux.intel.com> wrote:
>
> On 12/11/25 20:59, 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.
> >
> > Signed-off-by: Mostafa Saleh <smostafa@...gle.com>
> > ---
> > .../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
>
> Do you need to update the MAINTAINERS file, since a new file (iommu-
> debug-pagealloc.h) is being added?
>
Sorry I missed this last time, that should be under the path of "IOMMU
SUBSYSTEM",
I am happy to maintain it, but it's up to Joerg and Will.
Thanks,
Mostafa
> >
> > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> > index a8d0afde7f85..d484d9d8d0a4 100644
> > --- a/Documentation/admin-guide/kernel-parameters.txt
> > +++ b/Documentation/admin-guide/kernel-parameters.txt
> > @@ -2675,6 +2675,15 @@ Kernel parameters
> > 1 - Bypass the IOMMU for DMA.
> > unset - Use value of CONFIG_IOMMU_DEFAULT_PASSTHROUGH.
> >
> > + iommu.debug_pagealloc=
> > + [KNL,EARLY] When CONFIG_IOMMU_DEBUG_PAGEALLOC is set, this
> > + parameter enables the feature at boot time. By default, it
> > + is disabled and the system behaves the same way as a kernel
> > + built without CONFIG_IOMMU_DEBUG_PAGEALLOC.
> > + Format: { "0" | "1" }
> > + 0 - Sanitizer disabled.
> > + 1 - Sanitizer enabled, expect runtime overhead.
>
> "iommu.debug_pagealloc=0" has the same meaning as "unset". Would
> "iommu=debug_pagealloc" look more appropriate?
>
> > +
> > io7= [HW] IO7 for Marvel-based Alpha systems
> > See comment before marvel_specify_io7 in
> > arch/alpha/kernel/core_marvel.c.
>
> [ ... ]
>
> Other changes look good to me.
>
> Reviewed-by: Lu Baolu <baolu.lu@...ux.intel.com>
Powered by blists - more mailing lists