On 30/09/2026 6:10 am, Anshuman Khandual wrote:
> On Tue, Sep 22, 2026 at 06:12:32PM +0100, Muhammad Usama Anjum wrote:
>> ptep_get() now accepts a pointer to hw_pte_t storage but must continue to
>> return a software PTE value. Add __pte_from_hw for both generic hw_pte_t
>> definitions. Read the hw_pte_t table element atomically before converting
>> it to pte_t.
>>
>> Signed-off-by: Muhammad Usama Anjum <[email protected]>
>> ---
>> Changes since v1:
>> - Use software PTE value terminology.
>>
>> Changes since RFC v1:
>> - Define __pte_from_hw for the opted-in generic wrapper.
>> - Apply READ_ONCE() to hw_pte_t before converting it to pte_t.
>> ---
>>  include/linux/pgtable.h       | 2 +-
>>  include/linux/pgtable_types.h | 2 ++
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h
>> index 19098e302b75a..41337da0d65aa 100644
>> --- a/include/linux/pgtable.h
>> +++ b/include/linux/pgtable.h
>> @@ -493,7 +493,7 @@ static inline int pudp_set_access_flags(struct 
>> vm_area_struct *vma,
>>  #ifndef ptep_get
>>  static inline pte_t ptep_get(hw_pte_t *ptep)
>>  {
>> -    return READ_ONCE(*ptep);
>> +    return __pte_from_hw(READ_ONCE(*ptep));
>>  }
> 
> Just curious - when would other pgtable levels (PMD, PUD, P4D and PGD) be 
> converted
> in this format as well ?

I've patches for conversion of all levels offline. But it would have been
so much difficult and complex (to review and rebase) if I would have posted
all of them. That's why this split was done. I'll be sending other conversion
after acceptance of these current series. PMD conversions has some patches
which require discussion. Other remaining levels are going to be straight
forward. Maybe I'll send those together.

-- 
Thanks,
Usama

Reply via email to