From: Wang YanQing <udknight@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: akpm@linux-foundation.org, willy@infradead.org,
torvalds@linux-foundation.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] arm: lpae: fix non-atomic page table entry update issue
Date: Sun, 3 May 2026 23:54:34 +0800 [thread overview]
Message-ID: <20260503155432.GA18098@udknight> (raw)
In-Reply-To: <abYHfGjqTRAB_oyR@shell.armlinux.org.uk>
On Sun, Mar 15, 2026 at 01:12:28AM +0000, Russell King (Oracle) wrote:
> On Sun, Mar 15, 2026 at 08:47:46AM +0800, Wang YanQing wrote:
> > The ARM Architecture Reference Manual explicitly dictates that writes of 64-bit
> > translation table descriptors must be single-copy atomic:
> > ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition (https://developer.arm.com/documentation/ddi0406/latest)
> > "
> > ...
> > A3.5.3 Atomicity in the ARM architecture
> > ...
> > In an implementation that includes the Large Physical Address Extension, LDRD, and STRD accesses to 64-bit aligned
> > locations are 64-bit single-copy atomic as seen by translation table walks and accesses to translation tables.
> > Note
> > The Large Physical Address Extension adds this requirement to avoid the need for complex measures to avoid
> > atomicity issues when changing translation table entries, without creating a requirement that all locations in the
> > memory system are 64-bit single-copy atomic.
>
> Thanks. Now, please locate where the need for the updates to the page
> tables needs to be done atomically, bearing in mind that we program
> SCTLR.AFE=1 and SCTLR.HA=0, meaning the hardware won't write-back to
> the page tables to e.g. update the access flag.
Dear Russell and all
ARM Cortex-A cores (cortex-a7, cortex-a32, cortex-a55) all have "walk cache ram",
according to cortex_a32_trm_100241_0100_00_en.pdf (https://documentation-service.arm.com/static/5e7dca43cbfe76649ba52835)
"
...
The walk cache RAM holds the result of a stage 1 translation up to but not including the last
level
...
"
The walk cache ram will cache translation result of L1/L2 page table walk, so the non-atomic
pmd entry update issue describe in the patch will cause partial updated 64-bit entry to be cached
in the walk cache ram.
On SoCs like TI keystone and Sigmastar SoCs which will run arm32 linux kernel on high address,
the physical address of page table will be 64-bit and will meet the issue described in the patch.
I think it is right to make page table entry update become atomic according to ARM Architecture
Reference Manual.
Thanks
>
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
prev parent reply other threads:[~2026-05-03 15:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-15 0:47 [PATCH v2] arm: lpae: fix non-atomic page table entry update issue Wang YanQing
2026-03-15 1:12 ` Russell King (Oracle)
2026-03-15 3:29 ` Wang YanQing
2026-04-11 12:27 ` Wang YanQing
2026-05-03 15:54 ` Wang YanQing [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260503155432.GA18098@udknight \
--to=udknight@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox