* [PATCH] riscv: Fixup pfn_valid error with wrong max_mapnr
@ 2021-01-21 6:31 ` guoren
0 siblings, 0 replies; 2+ messages in thread
From: guoren @ 2021-01-21 6:31 UTC (permalink / raw)
To: palmerdabbelt; +Cc: linux-riscv, linux-kernel, Guo Ren
From: Guo Ren <guoren@linux.alibaba.com>
The max_mapnr is the number of PFNs, not absolute PFN offset.
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
---
arch/riscv/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index bf5379135e39..1576ee9e5e94 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -184,7 +184,7 @@ void __init setup_bootmem(void)
max_pfn = PFN_DOWN(memblock_end_of_DRAM());
max_low_pfn = max_pfn;
dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn));
- set_max_mapnr(max_low_pfn);
+ set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);
#ifdef CONFIG_BLK_DEV_INITRD
setup_initrd();
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] riscv: Fixup pfn_valid error with wrong max_mapnr
@ 2021-01-21 6:31 ` guoren
0 siblings, 0 replies; 2+ messages in thread
From: guoren @ 2021-01-21 6:31 UTC (permalink / raw)
To: palmerdabbelt; +Cc: linux-riscv, Guo Ren, linux-kernel
From: Guo Ren <guoren@linux.alibaba.com>
The max_mapnr is the number of PFNs, not absolute PFN offset.
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Cc: Palmer Dabbelt <palmerdabbelt@google.com>
---
arch/riscv/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index bf5379135e39..1576ee9e5e94 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -184,7 +184,7 @@ void __init setup_bootmem(void)
max_pfn = PFN_DOWN(memblock_end_of_DRAM());
max_low_pfn = max_pfn;
dma32_phys_limit = min(4UL * SZ_1G, (unsigned long)PFN_PHYS(max_low_pfn));
- set_max_mapnr(max_low_pfn);
+ set_max_mapnr(max_low_pfn - ARCH_PFN_OFFSET);
#ifdef CONFIG_BLK_DEV_INITRD
setup_initrd();
--
2.17.1
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-21 6:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21 6:31 [PATCH] riscv: Fixup pfn_valid error with wrong max_mapnr guoren
2021-01-21 6:31 ` guoren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.