Skip to content

Commit 5f77108

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
riscv: Do not restrict memory size because of linear mapping on nommu
It makes no sense to restrict physical memory size because of linear mapping size constraints when there is no linear mapping, so only do that when mmu is enabled. Reported-by: Geert Uytterhoeven <[email protected]> Closes: https://lore.kernel.org/linux-riscv/CAMuHMdW0bnJt5GMRtOZGkTiM7GK4UaLJCDMF_Ouq++fnDKi3_A@mail.gmail.com/ Fixes: 3b65644 ("riscv: Fix linear mapping checks for non-contiguous memory regions") Signed-off-by: Alexandre Ghiti <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 5ba7a75 commit 5f77108

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static void __init setup_bootmem(void)
252252
* The size of the linear page mapping may restrict the amount of
253253
* usable RAM.
254254
*/
255-
if (IS_ENABLED(CONFIG_64BIT)) {
255+
if (IS_ENABLED(CONFIG_64BIT) && IS_ENABLED(CONFIG_MMU)) {
256256
max_mapped_addr = __pa(PAGE_OFFSET) + KERN_VIRT_SIZE;
257257
memblock_cap_memory_range(phys_ram_base,
258258
max_mapped_addr - phys_ram_base);

0 commit comments

Comments
 (0)