diff options
| author | Alexandre Ghiti <alexghiti@rivosinc.com> | 2024-08-27 08:52:30 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-12 11:13:12 +0200 |
| commit | 339b880e7ced0cf865e02a1dc3f32c82d1de1c8f (patch) | |
| tree | 9d9ab89315489c746ca7220345c06cccf601f61d /arch | |
| parent | 775a2238aa989a9345c11542fbac19b87de1a397 (diff) | |
| download | linux-339b880e7ced0cf865e02a1dc3f32c82d1de1c8f.tar.gz linux-339b880e7ced0cf865e02a1dc3f32c82d1de1c8f.tar.bz2 linux-339b880e7ced0cf865e02a1dc3f32c82d1de1c8f.zip | |
riscv: Do not restrict memory size because of linear mapping on nommu
[ Upstream commit 5f771088a2b5edd6f2c5c9f34484ca18dc389f3e ]
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: 3b6564427aea ("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>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/riscv/mm/init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index c5c66f53971a..91346c9da8ef 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -251,7 +251,7 @@ static void __init setup_bootmem(void) * The size of the linear page mapping may restrict the amount of * 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; memblock_cap_memory_range(phys_ram_base, max_mapped_addr - phys_ram_base); |
