Re: [RFC PATCH 10/34] x86: mm: carve out the generic compile-time folded pgtable case in effective_prot()
"David Hildenbrand (Arm)" <[email protected]> Wed, 15 Jul 2026 11:43:20 +0200
| Newsgroups | org.kernel.vger.linux-csky,dev.linux.lists.loongarch,org.infradead.lists.kvm-riscv,org.infradead.lists.linux-riscv,org.kernel.vger.linux-arch,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k,org.kernel.vger.linux-mips,org.kernel.vger.linux-openrisc |
|---|---|
| Message-ID | <[email protected]> |
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