[PATCH 0/2] iommu: debug-pagealloc: Remove pfn_valid() usage

Mostafa Saleh posted 2 patches 2 weeks, 5 days ago
There is a newer version of this series
drivers/iommu/iommu-debug-pagealloc.c | 31 ++++++++++++---------------
include/linux/page_ext.h              |  6 ++++++
mm/page_ext.c                         | 23 ++++++++++++++++++++
3 files changed, 43 insertions(+), 17 deletions(-)
[PATCH 0/2] iommu: debug-pagealloc: Remove pfn_valid() usage
Posted by Mostafa Saleh 2 weeks, 5 days ago
This is a small fix for the new config IOMMU_DEBUG_PAGEALLOC based
on the discussion:
https://lore.kernel.org/linux-iommu/CAFgf54pBAUm3ao-UJksiuGKtvv4wzRyFq_uKwLe0H1ettO4DLQ@mail.gmail.com/

Where it was concluded that pfn_valid() is not enough to validate
physical addresses before access to page_ext.

The first patch introduces a new function in page_ext that takes a
physical address as an argument, and the second patch uses it instead
of calling pfn_valid() and phys_to_page()

Benchmarks with the new implementation can be found in:
https://lore.kernel.org/linux-iommu/20260114164322.787125-1-smostafa@google.com/

This series applies to iommu/core tree.

Mostafa Saleh (2):
  mm/page_ext: Add page_ext_get_phys()
  iommu: debug-pagealloc: Use page_ext_get_phys()

 drivers/iommu/iommu-debug-pagealloc.c | 31 ++++++++++++---------------
 include/linux/page_ext.h              |  6 ++++++
 mm/page_ext.c                         | 23 ++++++++++++++++++++
 3 files changed, 43 insertions(+), 17 deletions(-)

-- 
2.52.0.457.g6b5491de43-goog
Re: [PATCH 0/2] iommu: debug-pagealloc: Remove pfn_valid() usage
Posted by David Hildenbrand (Red Hat) 2 weeks, 5 days ago
On 1/19/26 15:22, Mostafa Saleh wrote:
> This is a small fix for the new config IOMMU_DEBUG_PAGEALLOC based
> on the discussion:
> https://lore.kernel.org/linux-iommu/CAFgf54pBAUm3ao-UJksiuGKtvv4wzRyFq_uKwLe0H1ettO4DLQ@mail.gmail.com/
> 
> Where it was concluded that pfn_valid() is not enough to validate
> physical addresses before access to page_ext.
> 
> The first patch introduces a new function in page_ext that takes a
> physical address as an argument, and the second patch uses it instead
> of calling pfn_valid() and phys_to_page()
> 
> Benchmarks with the new implementation can be found in:
> https://lore.kernel.org/linux-iommu/20260114164322.787125-1-smostafa@google.com/
> 
> This series applies to iommu/core tree.

This is part of v7 [1], right? Can't we just apply v7 instead or are the 
commit IDs already stable?

[1] https://lkml.kernel.org/r/20260114164322.787125-1-smostafa@google.com

-- 
Cheers

David
Re: [PATCH 0/2] iommu: debug-pagealloc: Remove pfn_valid() usage
Posted by Mostafa Saleh 2 weeks, 5 days ago
On Mon, Jan 19, 2026 at 2:27 PM David Hildenbrand (Red Hat)
<david@kernel.org> wrote:
>
> On 1/19/26 15:22, Mostafa Saleh wrote:
> > This is a small fix for the new config IOMMU_DEBUG_PAGEALLOC based
> > on the discussion:
> > https://lore.kernel.org/linux-iommu/CAFgf54pBAUm3ao-UJksiuGKtvv4wzRyFq_uKwLe0H1ettO4DLQ@mail.gmail.com/
> >
> > Where it was concluded that pfn_valid() is not enough to validate
> > physical addresses before access to page_ext.
> >
> > The first patch introduces a new function in page_ext that takes a
> > physical address as an argument, and the second patch uses it instead
> > of calling pfn_valid() and phys_to_page()
> >
> > Benchmarks with the new implementation can be found in:
> > https://lore.kernel.org/linux-iommu/20260114164322.787125-1-smostafa@google.com/
> >
> > This series applies to iommu/core tree.
>
> This is part of v7 [1], right? Can't we just apply v7 instead or are the
> commit IDs already stable?
>

It should be stable according to Will:
https://lore.kernel.org/linux-iommu/20260114164322.787125-1-smostafa@google.com/T/#m59d0b455e3f2160cb6f9980a0ae65bc481c53898

Thanks,
Mostafa

> [1] https://lkml.kernel.org/r/20260114164322.787125-1-smostafa@google.com
>
> --
> Cheers
>
> David
Re: [PATCH 0/2] iommu: debug-pagealloc: Remove pfn_valid() usage
Posted by David Hildenbrand (Red Hat) 2 weeks, 5 days ago
On 1/19/26 16:09, Mostafa Saleh wrote:
> On Mon, Jan 19, 2026 at 2:27 PM David Hildenbrand (Red Hat)
> <david@kernel.org> wrote:
>>
>> On 1/19/26 15:22, Mostafa Saleh wrote:
>>> This is a small fix for the new config IOMMU_DEBUG_PAGEALLOC based
>>> on the discussion:
>>> https://lore.kernel.org/linux-iommu/CAFgf54pBAUm3ao-UJksiuGKtvv4wzRyFq_uKwLe0H1ettO4DLQ@mail.gmail.com/
>>>
>>> Where it was concluded that pfn_valid() is not enough to validate
>>> physical addresses before access to page_ext.
>>>
>>> The first patch introduces a new function in page_ext that takes a
>>> physical address as an argument, and the second patch uses it instead
>>> of calling pfn_valid() and phys_to_page()
>>>
>>> Benchmarks with the new implementation can be found in:
>>> https://lore.kernel.org/linux-iommu/20260114164322.787125-1-smostafa@google.com/
>>>
>>> This series applies to iommu/core tree.
>>
>> This is part of v7 [1], right? Can't we just apply v7 instead or are the
>> commit IDs already stable?
>>
> 
> It should be stable according to Will:
> https://lore.kernel.org/linux-iommu/20260114164322.787125-1-smostafa@google.com/T/#m59d0b455e3f2160cb6f9980a0ae65bc481c53898

Shame, probably applied a bit too fast ...

-- 
Cheers

David