riscv: Fix early alternative patching
authorSamuel Holland <samuel@sholland.org>
Sun, 12 Feb 2023 02:15:32 +0000 (20:15 -0600)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 15 Feb 2023 00:10:35 +0000 (16:10 -0800)
commitbfd6fc5d80145e12d0ffa144c4bad89b8f9ddc5a
tree67f1bd7b948267de073d13c40d669a177af86bb9
parent5f365c133b83a584953179fc771cf131668e82ee
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>
arch/riscv/errata/thead/errata.c