[PATCH] arm64/mm: Add a fallback stub for pgd_page_paddr()
Anshuman Khandual
anshuman.khandual at arm.com
Wed Nov 5 17:59:55 PST 2025
On 05/11/25 10:33 PM, Will Deacon wrote:
> On Wed, Nov 05, 2025 at 08:24:40AM +0530, Anshuman Khandual wrote:
>> On 04/11/25 8:01 PM, Will Deacon wrote:
>>> On Tue, Oct 14, 2025 at 12:06:33PM +0100, Anshuman Khandual wrote:
>>>> Add a fallback stub for pgd_page_paddr() when (PGTBALE_LEVELS <= 4) which
>>>
>>> typo
>>
>> Sure will change - s/Add/Adds
>>>
>>>> helps in intercepting any unintended usage and which is also in line with
>>>> existing stubs for similar [pud|p4d]_page_paddr() helpers.
>>>
>>> Are you saying the kernel compiles in this case without your patch? Which
>>> definition of pgd_page_paddr() does it end up using?
>>
>> Kernel compiles for PGTBALE_LEVELS <= 4 just fine without this patch as both
>> its current users p4d_offset_phys() and p4d_offset_lockless() are wrapped in
>> with PGTBALE_LEVELS > 4.
>
> Ok, but your patch is trying to catch broken users of the macro, right?
Right but there are no broken users at present because all the users are
wrapped inside #ifdef PGTBALE_LEVELS > 4.
> So my question is, would such a user compile today? If not, then your
> patch is pointless.
The point is this macro is not visible outside #ifdef PGTBALE_LEVELS > 4
where as similar ones such as p4d_page_paddr() and pud_page_paddr() are
always visible via their respective fallback stubs, when PGTABLE_LEVELS
are lower.
More information about the linux-arm-kernel
mailing list