On 7/13/26 16:55, Dave Hansen wrote:
> On 7/13/26 07:41, David Hildenbrand (Arm) wrote:
>> Essentially, we have to teach x86 code to ignore levels that are folded 
>> (e.g.,
>> pgd, p4d) and start collecting effective prots from the actual first 
>> non-folded
>> level.
> 
> I guess that's what the series really comes down to.
> 
> The model is moving from (using 3-level PAE as an example):
> 
>  PGD => ...folding => PMD => PTE
> 
> to
> 
>  ...folding => PUD => PMD => PTE
> 
> Right?

Not quite, because it's complicated:

static inline int pgd_none(pgd_t pgd)           { return 0; }
static inline int pgd_bad(pgd_t pgd)            { return 0; }
static inline int pgd_present(pgd_t pgd)        { return 1; }
static inline void pgd_clear(pgd_t *pgd)        { }
#define p4d_ERROR(p4d)                          (pgd_ERROR((p4d).pgd))

#define pgd_populate(mm, pgd, p4d)              do { } while (0)
#define pgd_populate_safe(mm, pgd, p4d)         do { } while (0)


It's always been the latter:

        ...folding => PUD => PMD => PTE


This series rather enforces that the latter is used consistently. (e.g., not
working on pgds when they are actually always look like present page tables)

We decided to go for strict BUILD_BUG() on set_pgd() etc. because otherwise it's
just waiting for trouble once we change what pgpd_get() returns.

-- 
Cheers,

David

Reply via email to