mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
riscv: Do not restrict memory size because of linear mapping on nommu
[ Upstream commit5f771088a2
] 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 <geert@linux-m68k.org> Closes: https://lore.kernel.org/linux-riscv/CAMuHMdW0bnJt5GMRtOZGkTiM7GK4UaLJCDMF_Ouq++fnDKi3_A@mail.gmail.com/ Fixes:3b6564427a
("riscv: Fix linear mapping checks for non-contiguous memory regions") Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20240827065230.145021-1-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8289dc916e
commit
bd29d84520
|
@ -235,7 +235,7 @@ static void __init setup_bootmem(void)
|
||||||
* The size of the linear page mapping may restrict the amount of
|
* The size of the linear page mapping may restrict the amount of
|
||||||
* usable RAM.
|
* usable RAM.
|
||||||
*/
|
*/
|
||||||
if (IS_ENABLED(CONFIG_64BIT)) {
|
if (IS_ENABLED(CONFIG_64BIT) && IS_ENABLED(CONFIG_MMU)) {
|
||||||
max_mapped_addr = __pa(PAGE_OFFSET) + KERN_VIRT_SIZE;
|
max_mapped_addr = __pa(PAGE_OFFSET) + KERN_VIRT_SIZE;
|
||||||
memblock_cap_memory_range(phys_ram_base,
|
memblock_cap_memory_range(phys_ram_base,
|
||||||
max_mapped_addr - phys_ram_base);
|
max_mapped_addr - phys_ram_base);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user