riscv: Get rid of riscv_pfn_base variable
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Fri, 24 Mar 2023 15:54:19 +0000 (16:54 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 19 Apr 2023 03:43:02 +0000 (20:43 -0700)
commita7407a1318a9d7b5a7de7ab19935de5fc4c47a57
tree886921cb4fac1bbdbedd5bb535c3a6084e1313c3
parentfe15c26ee26efa11741a7b632e9f23b01aca4cc6
riscv: Get rid of riscv_pfn_base variable

Use directly phys_ram_base instead, riscv_pfn_base is just the pfn of
the address contained in phys_ram_base.

Even if there is no functional change intended in this patch, actually
setting phys_ram_base that early changes the behaviour of
kernel_mapping_pa_to_va during the early boot: phys_ram_base used to be
zero before this patch and now it is set to the physical start address of
the kernel. But it does not break the conversion of a kernel physical
address into a virtual address since kernel_mapping_pa_to_va should only
be used on kernel physical addresses, i.e. addresses greater than the
physical start address of the kernel.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Tested-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20230324155421.271544-2-alexghiti@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/page.h
arch/riscv/mm/init.c