浏览代码

arm64: mm: free __init memory via the linear mapping

The implementation of free_initmem_default() expects __init_begin
and __init_end to be covered by the linear mapping, which is no
longer the case. So open code it instead, using addresses that are
explicitly translated from kernel virtual to linear virtual.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Ard Biesheuvel 9 年之前
父节点
当前提交
d386825c95
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      arch/arm64/mm/init.c

+ 2 - 1
arch/arm64/mm/init.c

@@ -452,7 +452,8 @@ void __init mem_init(void)
 
 void free_initmem(void)
 {
-	free_initmem_default(0);
+	free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)),
+			   0, "unused kernel");
 	fixup_init();
 }