riscv: xip: support runtime trap patching
authorVitaly Wool <vitaly.wool@konsulko.com>
Mon, 31 May 2021 08:53:42 +0000 (11:53 +0300)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Thu, 10 Jun 2021 23:16:06 +0000 (16:16 -0700)
commit5e63215c2f64079fbd011df5005c8bea63f149c2
tree521335babc29f534c56570d246aed170ddc26822
parent160ce364167fabf8df5bebfff1b38fd5d8c146c9
riscv: xip: support runtime trap patching

RISCV_ERRATA_ALTERNATIVE patches text at runtime which is currently
not possible when the kernel is executed from the flash in XIP mode.
Since runtime patching concerns only traps at the moment, let's just
have all the traps reside in RAM anyway if RISCV_ERRATA_ALTERNATIVE
is set. Thus, these functions will be patch-able even when the .text
section is in flash.

Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/traps.c
arch/riscv/kernel/vmlinux-xip.lds.S