Re: [PATCH RFC v3 14/21] x86: mm: carve out the generic compile-time folded pgtable case in effective_prot()

From: David Hildenbrand (Arm)

Date: Thu Sep 10 2026 - 07:15:38 EST


On 9/2/26 13:56, Yeoreum Yun wrote:
> The behaviour of pXdp_get() will change with generic compile-time folded
> page tables. To prepare for that, rework effective_prot() to ignore any
> folded page tables entries, as it will unconditionally get called by
> ptdump core with pXd_val(pXdp_get()), and the value for folded entries
> really should be ignored.
>
> For this, introduce mm_first_pgtable_level() to identify the first real
> page-table level, move mm_pXd_folded() in !__ASSEMBLER__ and
> update effective_prot with higher_prot only when the current entry is not
> folded nor the first level.
>
> There should be no functional change.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>

Reviewed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

--
Cheers,

David