v3
2026-10-08
修复保留内存初始化几个问题 · v3
修复 reserved_mem 初始化错误处理:no-map 区域释放/保留、失败区域跳过及重叠检查。
原始补丁链接
子 Patch(5)
1/5
of: reserved_mem: release dynamically allocated no-map region on init failure
From: Wandun Chen chenwandun@lixiang.com Dynamically reserved-memory regions are added to memblock.reserved by memblock_phys_alloc_range() during __reserved_mem_alloc_size(). When a reserved-memory
2/5
of: reserved_mem: retain static no-map memory on init failure
From: Wandun Chen chenwandun@lixiang.com Static no-map reserved-memory regions are initialized after paging_init(). If initialization fails, MEMBLOCK_NOMAP would be cleared, and the memory is avail
3/5
of: reserved_mem: skip init for regions whose early reservation failed
From: Wandun Chen chenwandun@lixiang.com __reserved_mem_reserve_reg() discards the error from early_init_dt_reserve_memory() and returns 0 unconditionally, so the caller counts the node in total_re
4/5
of: reserved_mem: reject static regions overlapping no-map memory
From: Wandun Chen chenwandun@lixiang.com Static no-map reserved-memory regions are marked in memblock.memory rather than memblock.reserved. So the reservation overlap check does not reject a static
5/5
of: reserved_mem: reject static mapped regions overlapping existing reservations
From: Wandun Chen chenwandun@lixiang.com memblock_reserve() permits overlapping reservations, so a statically placed region whose ‘reg’ overlaps an existing one is accepted. When initialization of