Re: [PATCH 02/17] arm64/mm: Convert READ_ONCE() as pmdp_get() while accessing PMD
From: David Hildenbrand (Arm)
Date: Wed Sep 16 2026 - 09:38:26 EST
On 9/16/26 15:32, David Hildenbrand (Arm) wrote:
> On 7/29/26 14:24, Anshuman Khandual wrote:
>> Convert all READ_ONCE() based PMD accesses as pmdp_get() instead which will
>> support both D64 and D128 translation regime going forward. That is because
>> READ_ONCE() would need 128 bit single copy atomic guarantees, while reading
>> 128 bit page table entries which is currently not supported on arm64. Build
>> fails for READ_ONCE() while accessing beyond 64 bits.
>>
>> Load Pair/Store Pair (ldp/stp) are only single copy atomic if FEAT_LSE128
>> is supported (which is required when FEAT_D128 is supported). Currently 128
>> bit pgtables is a compile time decision - so we could have chosen to extend
>> READ_ONCE()/WRITE_ONCE() to allow 128 bit for this configuration. But then
>> it's a general purpose API and we were concerned that other users might
>> eventually creep in that expect 128 and then fail to compile in the other
>> configs.
>>
>> But worse, we are considering eventually making D128 a boot time option, at
>> which point we'd have to make READ_ONCE() always allow 128 bit at compile
>> time but then it might silently tear at runtime.
>>
>> So our preference is to standardize on these existing helpers, which we can
>> override in arm64 to give the 128 bit single copy guarantee when required.
>>
>
> Best to mention here that no functional change is expect because the common-cde
> pmdp_get() etc helpers do exactly that.
>
> Reviewed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
>
Whops, accidentally stumbled into v1 in my inbox after starting to look at v2 :D
--
Cheers,
David