Linux mm gains ALLOC_UNMAPPED for direct-map-free pages
Brendan Jackman's v3 series lays allocator and mapping groundwork for guest_memfd isolation and Address Space Isolation.
The Linux memory-management subsystem is gaining a first-class way to allocate pages that never appear in the kernel direct map. Brendan Jackman's 26-patch v3 series introduces ALLOC_UNMAPPED and the AS_NO_DIRECT_MAP address-space flag so the page allocator can hand out, and later reclaim, memory whose physical frames stay unmapped from the physmap.
The work is aimed at two near-term users. guest_memfd wants guest RAM kept out of the direct map so host kernel bugs cannot touch it; one sticking point has been cheaply killing residual TLB entries. Address Space Isolation (ASI) needs the same efficient unmapped supply, though ASI only has to drop the pages from its own special page tables. Jackman describes ALLOC_UNMAPPED as a Trojan horse that also lands the "mermap," a CPU-local ephemeral mapping facility for touching those pages when the kernel must zero or populate them without a global direct-map alias.
Design-wise the series reuses earlier ASI allocator ideas but generalizes them to full direct-map removal. Unmapped status is tracked at pageblock granularity so freelist indexing, compaction, and TLB shootdowns stay batched. A new mm-local kernel virtual region, initialized on demand per process, hosts the mermap and avoids paying page-table cost for tasks that never need it. secretmem is folded onto AS_NO_DIRECT_MAP, retiring its one-off rejection checks; not every guest_memfd mapping will set the flag, so GUP and KVM paths that still need access are left alone for now.
Longer term the same primitive unlocks broader hardening: dropping unused vmalloc aliases, or eventually unmapping all user pages from the direct map. Non-security uses are already on the radar, including memory-firewalled devices and a path toward retiring execmem as a separate layer. Vlastimil Babka, Mike Rapoport, and Yosry Ahmed have been reviewing the series on the linux-kernel list, with Babka supplying multiple Reviewed-bys on the allocator and compaction pieces.