From: Palmer Dabbelt Date: Fri, 4 Feb 2022 21:14:08 +0000 (-0800) Subject: riscv/mm: Add XIP_FIXUP for riscv_pfn_base X-Git-Tag: baikal/mips/sdk6.1~6441^2~3 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=a179f8079df90410b444ed343884c66b4f5c7385;p=kernel.git riscv/mm: Add XIP_FIXUP for riscv_pfn_base This manifests as a crash early in boot on VexRiscv. Signed-off-by: Myrtle Shah [Palmer: split commit] Fixes: 481bac616443 ("RISC-V: enable XIP") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index eecfacac2cc51..c27294128e182 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -232,6 +232,7 @@ static pmd_t __maybe_unused early_dtb_pmd[PTRS_PER_PMD] __initdata __aligned(PAG #ifdef CONFIG_XIP_KERNEL #define pt_ops (*(struct pt_alloc_ops *)XIP_FIXUP(&pt_ops)) +#define riscv_pfn_base (*(unsigned long *)XIP_FIXUP(&riscv_pfn_base)) #define trampoline_pg_dir ((pgd_t *)XIP_FIXUP(trampoline_pg_dir)) #define fixmap_pte ((pte_t *)XIP_FIXUP(fixmap_pte)) #define early_pg_dir ((pgd_t *)XIP_FIXUP(early_pg_dir))