[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/9] mm: use hw_pte_t for generic PTE table storage



On 9/30/26 19:40, Muhammad Usama Anjum wrote:
> On 30/09/2026 5:35 am, Anshuman Khandual wrote:
>> On Tue, Sep 22, 2026 at 06:12:31PM +0100, Muhammad Usama Anjum wrote:
>>> Generic page-table interfaces use pte_t * for both pointers to PTE table
>>> storage and pointers to software PTE values. Convert the generic
>>> declarations and their MM, fs, and kernel users together so parameters,
>>> return types, callbacks, and local pointers that designate table storage
>>> use hw_pte_t *.
>>>
>>> Include linux/pgtable_types.h from headers that expose the converted
>>> interfaces. It continues to provide pgprot_t to vmalloc.h through
>>> asm/page.h.
>>>
>>> Keep software PTE values as pte_t and retain pte_t * for value interfaces.
>>>
>>> No architecture selects ARCH_HAS_HW_PTE_T at this point, so hw_pte_t
>>> remains an alias of pte_t and this changes the interface vocabulary without
>>> changing representation or behavior.
>>>
>>> Most of this mechanical conversion was generated with the Coccinelle script
>>> included in the cover letter. The script deliberately ignores pte_t *
>>
>> Just wondering - should this Coccinelle script that converted all these
>> instances be saved inside ./scripts/coccinelle/ for future referene.
> 
> Thanks for the suggestion. This script was written for this one-time 
> conversion
> and requires manual review to distinguish HW PTE table pointers from SW PTE
> pointers. After the conversion, it would not be useful.
> (Maybe other arch can use it to do their conversion. But they can always
> copy script from the series)

Agreed, the script is not expected to be reused once merged. Which is different
to other conversions where the old way of doing it can silently sneak in again.

-- 
Cheers,

David



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.