]> www.infradead.org Git - users/jedix/linux-maple.git/commit
riscv: sifive: Apply errata "cip-453" patch
authorVincent Chen <vincent.chen@sifive.com>
Mon, 22 Mar 2021 14:26:05 +0000 (22:26 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Sun, 11 Apr 2021 20:25:57 +0000 (13:25 -0700)
commitfeb3ac16051f90e5cd096d12dc3742127b405b79
treeb38d59c10988be6a6cefc8e3f2a0a44746a0b790
parentb382bf91bbadd6e6cb74eb307a26cf3230de54b8
riscv: sifive: Apply errata "cip-453" patch

Add sign extension to the $badaddr before addressing the instruction page
fault and instruction access fault to workaround the issue "cip-453".

To avoid affecting the existing code sequence, this patch will creates two
trampolines to add sign extension to the $badaddr. By the "alternative"
mechanism, these two trampolines will replace the original exception
handler of instruction page fault and instruction access fault in the
excp_vect_table. In this case, only the specific SiFive CPU core jumps to
the do_page_fault and do_trap_insn_fault through these two trampolines.
Other CPUs are not affected.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/Kconfig.erratas
arch/riscv/errata/sifive/Makefile
arch/riscv/errata/sifive/errata.c
arch/riscv/errata/sifive/errata_cip_453.S [new file with mode: 0644]
arch/riscv/include/asm/errata_list.h
arch/riscv/kernel/entry.S