[PATCH 0/4] arm64/mm: Convert pgtable READ_ONCE() as pxdp_get()

Anshuman Khandual posted 4 patches 3 weeks, 2 days ago
There is a newer version of this series
arch/arm64/include/asm/pgtable.h |  6 ++--
arch/arm64/mm/fault.c            |  8 ++---
arch/arm64/mm/fixmap.c           |  6 ++--
arch/arm64/mm/hugetlbpage.c      | 10 +++---
arch/arm64/mm/kasan_init.c       | 18 +++++-----
arch/arm64/mm/mmu.c              | 60 ++++++++++++++++----------------
arch/arm64/mm/pageattr.c         |  8 ++---
arch/arm64/mm/trans_pgd.c        | 14 ++++----
8 files changed, 66 insertions(+), 64 deletions(-)
[PATCH 0/4] arm64/mm: Convert pgtable READ_ONCE() as pxdp_get()
Posted by Anshuman Khandual 3 weeks, 2 days ago
Route READ_ONCE() accesses on pgtable entries via level specific generic MM
pxdp_get() helpers which platforms could then override when required. These
accessors on arm64, will help in ensuring page table accesses are performed
in an atomic manner while reading 128 bit page table entries later. But for
now they just default to READ_ONCE(), thus preserving existing behaviour on
current D64 translation.

This is similar to generic MM, where all atomic accesses have already been
converted from READ_ONCE() into pgtable level specific accessors.

These are preparatory patches for D128 enablement, although standing their
own for D64 translation as well. These patches are split from earlier D128
V1 series. There are no functional changes here, and besides mm kselftests
do not show any regression.

https://lore.kernel.org/linux-mm/20260729122452.3797443-1-anshuman.khandual@arm.com/

This series applies on v3.7-rc1 but after applying the following patches
related to pgtable entry print standardization posted earlier.

https://lore.kernel.org/linux-mm/20260831054331.625505-1-anshuman.khandual@arm.com/

https://lore.kernel.org/linux-mm/20260901065454.1906343-1-anshuman.khandual@arm.com/

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Linu Cherian <linu.cherian@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org

Anshuman Khandual (4):
  arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMD
  arm64/mm: Convert READ_ONCE() as pudp_get() while accessing PUD
  arm64/mm: Convert READ_ONCE() as p4dp_get() while accessing P4D
  arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGD

 arch/arm64/include/asm/pgtable.h |  6 ++--
 arch/arm64/mm/fault.c            |  8 ++---
 arch/arm64/mm/fixmap.c           |  6 ++--
 arch/arm64/mm/hugetlbpage.c      | 10 +++---
 arch/arm64/mm/kasan_init.c       | 18 +++++-----
 arch/arm64/mm/mmu.c              | 60 ++++++++++++++++----------------
 arch/arm64/mm/pageattr.c         |  8 ++---
 arch/arm64/mm/trans_pgd.c        | 14 ++++----
 8 files changed, 66 insertions(+), 64 deletions(-)

-- 
2.43.0
Re: [PATCH 0/4] arm64/mm: Convert pgtable READ_ONCE() as pxdp_get()
Posted by David Hildenbrand (Arm) 4 days, 17 hours ago
On 9/3/26 08:06, Anshuman Khandual wrote:
> Route READ_ONCE() accesses on pgtable entries via level specific generic MM
> pxdp_get() helpers which platforms could then override when required. These
> accessors on arm64, will help in ensuring page table accesses are performed
> in an atomic manner while reading 128 bit page table entries later. But for
> now they just default to READ_ONCE(), thus preserving existing behaviour on
> current D64 translation.
> 
> This is similar to generic MM, where all atomic accesses have already been
> converted from READ_ONCE() into pgtable level specific accessors.
> 
> These are preparatory patches for D128 enablement, although standing their
> own for D64 translation as well. These patches are split from earlier D128
> V1 series. There are no functional changes here, and besides mm kselftests
> do not show any regression.
> 
> https://lore.kernel.org/linux-mm/20260729122452.3797443-1-anshuman.khandual@arm.com/
> 
> This series applies on v3.7-rc1 but after applying the following patches
> related to pgtable entry print standardization posted earlier.
> 
> https://lore.kernel.org/linux-mm/20260831054331.625505-1-anshuman.khandual@arm.com/
> 
> https://lore.kernel.org/linux-mm/20260901065454.1906343-1-anshuman.khandual@arm.com/
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Lorenzo Stoakes <ljs@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@kernel.org>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: Linu Cherian <linu.cherian@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> 
> Anshuman Khandual (4):
>   arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMD
>   arm64/mm: Convert READ_ONCE() as pudp_get() while accessing PUD
>   arm64/mm: Convert READ_ONCE() as p4dp_get() while accessing P4D
>   arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGD
> 
>  arch/arm64/include/asm/pgtable.h |  6 ++--
>  arch/arm64/mm/fault.c            |  8 ++---
>  arch/arm64/mm/fixmap.c           |  6 ++--
>  arch/arm64/mm/hugetlbpage.c      | 10 +++---
>  arch/arm64/mm/kasan_init.c       | 18 +++++-----
>  arch/arm64/mm/mmu.c              | 60 ++++++++++++++++----------------
>  arch/arm64/mm/pageattr.c         |  8 ++---
>  arch/arm64/mm/trans_pgd.c        | 14 ++++----
>  8 files changed, 66 insertions(+), 64 deletions(-)
Skimmed the changes, purely mechanical changes, so looks good.

Consider spelling out in the patches "No functional change intended."

-- 
Cheers,

David
Re: [PATCH 0/4] arm64/mm: Convert pgtable READ_ONCE() as pxdp_get()
Posted by Ryan Roberts 4 days, 21 hours ago
On 03/09/2026 07:06, Anshuman Khandual wrote:
> Route READ_ONCE() accesses on pgtable entries via level specific generic MM
> pxdp_get() helpers which platforms could then override when required. These
> accessors on arm64, will help in ensuring page table accesses are performed
> in an atomic manner while reading 128 bit page table entries later. But for
> now they just default to READ_ONCE(), thus preserving existing behaviour on
> current D64 translation.
> 
> This is similar to generic MM, where all atomic accesses have already been
> converted from READ_ONCE() into pgtable level specific accessors.
> 
> These are preparatory patches for D128 enablement, although standing their
> own for D64 translation as well. These patches are split from earlier D128
> V1 series. There are no functional changes here, and besides mm kselftests
> do not show any regression.
> 
> https://lore.kernel.org/linux-mm/20260729122452.3797443-1-anshuman.khandual@arm.com/
> 
> This series applies on v3.7-rc1 but after applying the following patches

I assume you meant v7.3-rc1 here?

> related to pgtable entry print standardization posted earlier.
> 
> https://lore.kernel.org/linux-mm/20260831054331.625505-1-anshuman.khandual@arm.com/

This applies.

> 
> https://lore.kernel.org/linux-mm/20260901065454.1906343-1-anshuman.khandual@arm.com/

This fails:
---8<---
$ b4 shazam 20260901065454.1906343-1-anshuman.khandual@arm.com
Grabbing thread from
lore.kernel.org/all/20260901065454.1906343-1-anshuman.khandual@arm.com/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
  Added from v3: 3 patches
  Added from v2: 3 patches
Analyzing 14 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Will use the latest revision: v3
You can pick other revisions using the -vN flag
Checking attestation on all messages, may take a moment...
---
  ✓ [PATCH v3 1/2] arm64/mm: Move __check_safe_pte_update()
  ✓ [PATCH v3 2/2] arm64/mm: Standardize printing for pgtable entries
  ---
  ✓ Signed: DKIM/arm.com
---
Total patches: 2
---
Applying: arm64/mm: Move __check_safe_pte_update()
Applying: arm64/mm: Standardize printing for pgtable entries
Patch failed at 0002 arm64/mm: Standardize printing for pgtable entries
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
error: patch failed: arch/arm64/mm/fault.c:160
error: arch/arm64/mm/fault.c: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the failed patch
---8<---

And as a result I can't apply this series. Any tips?

Thanks,
Ryan


> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Lorenzo Stoakes <ljs@kernel.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Hildenbrand <david@kernel.org>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: Linu Cherian <linu.cherian@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> 
> Anshuman Khandual (4):
>   arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMD
>   arm64/mm: Convert READ_ONCE() as pudp_get() while accessing PUD
>   arm64/mm: Convert READ_ONCE() as p4dp_get() while accessing P4D
>   arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGD
> 
>  arch/arm64/include/asm/pgtable.h |  6 ++--
>  arch/arm64/mm/fault.c            |  8 ++---
>  arch/arm64/mm/fixmap.c           |  6 ++--
>  arch/arm64/mm/hugetlbpage.c      | 10 +++---
>  arch/arm64/mm/kasan_init.c       | 18 +++++-----
>  arch/arm64/mm/mmu.c              | 60 ++++++++++++++++----------------
>  arch/arm64/mm/pageattr.c         |  8 ++---
>  arch/arm64/mm/trans_pgd.c        | 14 ++++----
>  8 files changed, 66 insertions(+), 64 deletions(-)
> 

Re: [PATCH 0/4] arm64/mm: Convert pgtable READ_ONCE() as pxdp_get()
Posted by Anshuman Khandual 4 days, 19 hours ago
On Mon, Sep 21, 2026 at 11:55:02AM +0100, Ryan Roberts wrote:
> On 03/09/2026 07:06, Anshuman Khandual wrote:
> > Route READ_ONCE() accesses on pgtable entries via level specific generic MM
> > pxdp_get() helpers which platforms could then override when required. These
> > accessors on arm64, will help in ensuring page table accesses are performed
> > in an atomic manner while reading 128 bit page table entries later. But for
> > now they just default to READ_ONCE(), thus preserving existing behaviour on
> > current D64 translation.
> > 
> > This is similar to generic MM, where all atomic accesses have already been
> > converted from READ_ONCE() into pgtable level specific accessors.
> > 
> > These are preparatory patches for D128 enablement, although standing their
> > own for D64 translation as well. These patches are split from earlier D128
> > V1 series. There are no functional changes here, and besides mm kselftests
> > do not show any regression.
> > 
> > https://lore.kernel.org/linux-mm/20260729122452.3797443-1-anshuman.khandual@arm.com/
> > 
> > This series applies on v3.7-rc1 but after applying the following patches
> 
> I assume you meant v7.3-rc1 here?

Oops ! that's correct.

> 
> > related to pgtable entry print standardization posted earlier.
> > 
> > https://lore.kernel.org/linux-mm/20260831054331.625505-1-anshuman.khandual@arm.com/
> 
> This applies.
> 
> > 
> > https://lore.kernel.org/linux-mm/20260901065454.1906343-1-anshuman.khandual@arm.com/
> 
> This fails:
> ---8<---
> $ b4 shazam 20260901065454.1906343-1-anshuman.khandual@arm.com
> Grabbing thread from
> lore.kernel.org/all/20260901065454.1906343-1-anshuman.khandual@arm.com/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
>   Added from v3: 3 patches
>   Added from v2: 3 patches
> Analyzing 14 messages in the thread
> Looking for additional code-review trailers on lore.kernel.org
> Will use the latest revision: v3
> You can pick other revisions using the -vN flag
> Checking attestation on all messages, may take a moment...
> ---
>   ✓ [PATCH v3 1/2] arm64/mm: Move __check_safe_pte_update()
>   ✓ [PATCH v3 2/2] arm64/mm: Standardize printing for pgtable entries
>   ---
>   ✓ Signed: DKIM/arm.com
> ---
> Total patches: 2
> ---
> Applying: arm64/mm: Move __check_safe_pte_update()
> Applying: arm64/mm: Standardize printing for pgtable entries
> Patch failed at 0002 arm64/mm: Standardize printing for pgtable entries
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> error: patch failed: arch/arm64/mm/fault.c:160
> error: arch/arm64/mm/fault.c: patch does not apply
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> ---8<---
> 
> And as a result I can't apply this series. Any tips?

May be this is based on older dependant patches.

The latest V3 does apply - although this series does not any more. 

https://lore.kernel.org/linux-mm/20260916044933.2689426-1-anshuman.khandual@arm.com/

I will respin the series updating the commit message as suggested on
the other thread but probably with a hosted git branch for better
access - should have just done that earlier given multiple moving
pieces here.

> 
> Thanks,
> Ryan
> 
> 
> > 
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Ryan Roberts <ryan.roberts@arm.com>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Lorenzo Stoakes <ljs@kernel.org>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: David Hildenbrand <david@kernel.org>
> > Cc: Mike Rapoport <rppt@kernel.org>
> > Cc: Linu Cherian <linu.cherian@arm.com>
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-kernel@vger.kernel.org
> > Cc: linux-mm@kvack.org
> > 
> > Anshuman Khandual (4):
> >   arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMD
> >   arm64/mm: Convert READ_ONCE() as pudp_get() while accessing PUD
> >   arm64/mm: Convert READ_ONCE() as p4dp_get() while accessing P4D
> >   arm64/mm: Convert READ_ONCE() as pgdp_get() while accessing PGD
> > 
> >  arch/arm64/include/asm/pgtable.h |  6 ++--
> >  arch/arm64/mm/fault.c            |  8 ++---
> >  arch/arm64/mm/fixmap.c           |  6 ++--
> >  arch/arm64/mm/hugetlbpage.c      | 10 +++---
> >  arch/arm64/mm/kasan_init.c       | 18 +++++-----
> >  arch/arm64/mm/mmu.c              | 60 ++++++++++++++++----------------
> >  arch/arm64/mm/pageattr.c         |  8 ++---
> >  arch/arm64/mm/trans_pgd.c        | 14 ++++----
> >  8 files changed, 66 insertions(+), 64 deletions(-)
> > 
>