RISC-V: fix auipc-jalr addresses in patched alternatives
authorHeiko Stuebner <heiko.stuebner@vrull.eu>
Fri, 23 Dec 2022 22:13:32 +0000 (23:13 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Dec 2022 14:59:52 +0000 (06:59 -0800)
commit27c653c06505f084bcb57f7575916d60efb32279
treebfa28b7b38414bca1ec2721c299c21bfbfb360ac
parent47f05757d3d898b4756d6d5c06e77a37337823e9
RISC-V: fix auipc-jalr addresses in patched alternatives

Alternatives live in a different section, so addresses used by call
functions will point to wrong locations after the patch got applied.

Similar to arm64, adjust the location to consider that offset.

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Link: https://lore.kernel.org/r/20221223221332.4127602-13-heiko@sntech.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/alternative.h
arch/riscv/kernel/alternative.c
arch/riscv/kernel/cpufeature.c