v2 2026-08-29

理顺 direct map 权限接口语义 · v2

v2 系列为 set_direct_map API 增加页数参数,execmem ROX 缓存改用 VM_FLUSH_RESET_PERMS,并回滚有混淆的 set_direct_map_valid_noflush。

原始补丁链接

子 Patch(6)

1/6
set_memory: add number of pages parameter to set_direct_map APIs
When set_direct_map APIs were introduced by the commit d253ca0c3865 (“x86/mm/cpa: Add set_direct_map_*() functions”) the single page parameter made sense because the initial callers (vmalloc and hiber
2/6
mm/vmalloc: set area's page_order after allocation succeeds
[mm/vmalloc: set area’s page_order after allocation succeeds] __vmalloc_area_node() calls set_vm_area_page_order() to set area’s page_order before actually allocating pages to populate the area. If a
3/6
mm/vmalloc: constify vm parameter of get_vm_area_page_order()
[mm/vmalloc: constify vm parameter of get_vm_area_page_order()] get_vm_area_page_order() and vm_area_page_order() do not need to modify struct vm_struct passed to them. Constify the parameter. Revie
4/6
mm/vmalloc: make set_area_direct_map HUGE_VMAP friendly
[mm/vmalloc: make set_area_direct_map HUGE_VMAP friendly] set_area_direct_map() always updates direct map alias permissions in single page increments. For HUGE_VMAP areas it’s suboptimal. Not only th
5/6
mm/execmem: use VM_FLUSH_RESET_PERMS for ROX cache allocations
[mm/execmem: use VM_FLUSH_RESET_PERMS for ROX cache allocations] Initially execmem completely removed direct map alias for the memory allocated for the ROX cache in PMD_SIZE chunks. When that memory w
6/6
Revert "arch: introduce set_direct_map_valid_noflush()"
Commit 0c6378a71574 (“arch: introduce set_direct_map_valid_noflush()”) added set_direct_map_valid_noflush() to allow updating the direct map for a physically contiguous range in execmem. As Brendan r