[PATCH] arm64/mm: Avoid direct referencing page table enties in map_range()

Will Deacon will at kernel.org
Thu Aug 1 04:34:41 PDT 2024


On Thu, Jul 25, 2024 at 11:36:56AM +0100, Ryan Roberts wrote:
> On 25/07/2024 10:10, Anshuman Khandual wrote:
> > Like else where in arm64 platform, use WRITE_ONCE() in map_range() while
> > creating page table entries. This avoids referencing page table entries
> > directly.
> 
> I could be wrong, but I don't think this code is ever operating on live
> pgtables? So there is never a potential to race with the HW walker and therefore
> no need to guarrantee copy atomicity? As long as the correct barriers are placed
> at the point where you load the pgdir into the TTBRx there should be no problem?
> 
> If my assertion is correct, I don't think there is any need for this change.

Agreed.

Will



More information about the linux-arm-kernel mailing list