v1
2026-10-09
vmap 失败时回滚部分映射 · v1
让 __vmap_pages_range_noflush() 等映射函数在失败时撤销已建立的 PTE,避免遗留映射使后续重映射命中残留而在 vmap_pte_range() 触发 BUG/WARN。
原始补丁链接
子 Patch(4)
1/4
mm/kmsan: undo the shadow mapping when the origin mapping fails
kmsan_vmap_pages_range_noflush() 先映射 shadow 再映射 origin;origin 失败时用 __vunmap_range_noflush 回滚 shadow PTE,避免残留映射使后续同区间 vmap 触发 BUG/WARN,无需 TLB flush。
2/4
mm/vmalloc: undo partial mappings inside the mapping functions
在 __vmap_pages_range_noflush()/vmap_page_range() 失败时统一撤销已装部分 PTE,解决调用者清理不一致;防止后续重映射撞残留导致 vmap_pte_range BUG/WARN,用 __vunmap_range_noflush 清 PTE 免 TLB flush。
3/4
powerpc: drop redundant unmaps of failed vmap mappings
vmap_page_range() and ioremap_page_range() clear the PTEs they installed when they fail, so the vunmap_range() in remap_isa_base() and ioremap_phb() has nothing left to remove. Signed-off-by: Hao Ge
4/4
mm/percpu: stop unmapping the CPU that failed to map
__pcpu_map_pages() clears the PTEs it installed when it fails, so pcpu_map_pages() only has to tear down the CPUs it mapped before the failing one. Signed-off-by: Hao Ge hao.ge@linux.dev — mm/pe