lkml.org 
[lkml]   [2019]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arm64: mm: fix max_mapnr is assigned the wrong value
Date
When we not use flat memory, the mem_map will be NULL and
pfn_to_page(max_pfn) is a pointer which is located in kernel space. So
max_mapnr is assigned a very large number(e.g., 0xffffxxxx_xxxxxxxx) - fix
it.

Signed-off-by: Muchun Song <smuchun@gmail.com>
---
arch/arm64/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index bc02818fa48b..e86c21a44c88 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -535,7 +535,7 @@ void __init mem_init(void)
else
swiotlb_force = SWIOTLB_NO_FORCE;

- set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
+ set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);

#ifndef CONFIG_SPARSEMEM_VMEMMAP
free_unused_memmap();
--
2.17.1
\
 
 \ /
  Last update: 2019-03-30 14:14    [W:0.043 / U:6.112 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site