Re: [PATCH V2 06/14] arm64/mm: Enable fixmap with 5 level page table
From: David Hildenbrand (Arm)
Date: Thu Sep 17 2026 - 18:14:49 EST
On 9/17/26 08:18, Anshuman Khandual wrote:
> On Wed, Sep 16, 2026 at 04:30:05PM +0200, David Hildenbrand (Arm) wrote:
>> On 9/7/26 05:50, Anshuman Khandual wrote:
>>> FEAT_D128 halves PTRS_PER_PXX thus shrinking the VA range coverage
>>> for each page table level. Hence in order to preserve all existing
>>> VA range configurations, some geometry now need to become 5-level.
>>>
>>
>> Hmm, wasn't this 5-levels before, but other code allocated+initialized the p4d
>> table for us?
>
> But fixmap was never 5 level earlier.
I mean the page table hierarchy. It's confusing.
>
>>
>> I mean, I see how we are filling in another level, but I don't see how we would
>> reconfigure something to use 5 page table levels?
>
> IIUC existing configurations which never required 5 levels would not need
> this reconfiguration even now.
We only map a handful of MB into a single leaf page table. The only reason why
we have to install more page tables into upper levels is because they were not
instantiated by other code.
>
>>
>>> Since fixmap is used to build and manipulate page tables early on
>>> during boot the mapping must also gain that additional level which
>>> was not required earlier.
>>
>> I am no expert ... but I am confused :)
>>
>> We do have a loop only in early_fixmap_init_pmd(). So we cannot possibly span
>> more than a single ... PTE table?
>>
>>>
>>> Enable fixmap with 5 level page table when required. This creates table
>>> entries at the PGD level. Add a fallback stub for pgd_page_paddr() when
>>> (PGTBALE_LEVELS <= 4) which helps in intercepting any unintended usage.
>>
>>
>> Again, I am very confused. Is it really just "As the page table layout changes,
>> we might no longer have a p4d table pre-populated for the range our fixmap falls
>> into. So if there is no p4d table yet, populate a static one just like we do for
>> the other levels."
>
> Right.
Best to rewrite the patch description along these lines.
--
Cheers,
David