[RFC PATCH 10/34] x86: mm: carve out the generic compile-time folded pgtable case in effective_prot()
David Hildenbrand (Arm)
david at kernel.org
Wed Jul 15 02:43:20 PDT 2026
On 7/14/26 20:28, Yeoreum Yun wrote:
> On Tue, Jul 14, 2026 at 06:31:22PM +0200, David Hildenbrand (Arm) wrote:
>>
>>>
>>> Agree. Calling a pXd_entry() about folded one seems meaningless.
>>> But seems enough to check mm_pXd_folded() before calling pXd_entry()
>>> in each walk_pXd_range().
>>
>> Needs some double-checking that callers can handle it (like effective_prot()
>> would currently not), but certainly something to look into!
>
> Most of mm_walk_ops *implicitly* handles the folded pgtable case
> (e.x) pXd_none() / pXd_present() and other can handle explicitly in
> its own handler.
>
> But, IMHO, It would be better to skip calling pXd_entry() in the
> walk_pXd_range() by checking the folded and this is clearer conceptually.
>
> For this, it requires the rewrite the walk_mm() where use only *p4d_entry()*
> to gather the leaf/non-leaf information for MGLRU.
Yeah, this needs a thought indeed.
--
Cheers,
David
More information about the kvm-riscv
mailing list