lib: sbi: Fixup tinst for exceptions in sbi_misaligned_*()
authordramforever <dramforever@live.com>
Thu, 9 Jun 2022 07:07:30 +0000 (15:07 +0800)
committerAnup Patel <anup@brainfault.org>
Tue, 21 Jun 2022 03:01:14 +0000 (08:31 +0530)
commit187127fb89b99790793d4b2663286371b59021ae
treea11df812442204a2873b7bb9016c0be9d59f6833
parent551c70c0405b98ae75698d1674c9e0e09fdc6e01
lib: sbi: Fixup tinst for exceptions in sbi_misaligned_*()

If there is an exception while emulating a misaligned load/store, fixup
uptrap.tinst before redirecting. Otherwise, HS-mode software may receive
an htinst describing the lbu/sb instruction that faulted during
emulation[1].

[1]: https://github.com/riscv-software-src/opensbi/issues/258

Signed-off-by: dramforever <dramforever@live.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/sbi/sbi_misaligned_ldst.c