summaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2023-02-12 05:15:32 +0300
committerPalmer Dabbelt <palmer@rivosinc.com>2023-02-15 03:10:35 +0300
commitbfd6fc5d80145e12d0ffa144c4bad89b8f9ddc5a (patch)
tree67f1bd7b948267de073d13c40d669a177af86bb9 /arch/riscv
parent5f365c133b83a584953179fc771cf131668e82ee (diff)
downloadlinux-bfd6fc5d80145e12d0ffa144c4bad89b8f9ddc5a.tar.xz
riscv: Fix early alternative patching
Now that the text to patch is located using a relative offset from the alternative entry, the text address should be computed without applying the kernel mapping offset, both before and after VM setup. Fixes: 8d23e94a4433 ("riscv: switch to relative alternative entries") Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Reviewed-by: Guo Ren <guoren@kernel.org> Reviewed-by: Jisheng Zhang <jszhang@kernel.org> Tested-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20230212021534.59121-2-samuel@sholland.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/errata/thead/errata.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/riscv/errata/thead/errata.c b/arch/riscv/errata/thead/errata.c
index c0bea5c94128..1dd90a5f86f0 100644
--- a/arch/riscv/errata/thead/errata.c
+++ b/arch/riscv/errata/thead/errata.c
@@ -102,9 +102,7 @@ void __init_or_module thead_errata_patch_func(struct alt_entry *begin, struct al
/* On vm-alternatives, the mmu isn't running yet */
if (stage == RISCV_ALTERNATIVES_EARLY_BOOT)
- memcpy((void *)__pa_symbol(oldptr),
- (void *)__pa_symbol(altptr),
- alt->alt_len);
+ memcpy(oldptr, altptr, alt->alt_len);
else
patch_text_nosync(oldptr, altptr, alt->alt_len);
}