Commit a07402ac authored by dramforever's avatar dramforever Committed by Anup Patel
Browse files

lib: sbi: Fix tval and tinst for sbi_get_insn()



We should not change trap->tval to mepc because mtval already points to
the faulting portion of the emulated instruction fetch, which is also
what stval is expected to be.

In addition, htinst is only allowed to be zero for instruction access
faults or page faults, and is only allowed to be zero or a
psuedoinstruction for instruction guest-page faults. Fix trap->tinst for
these cases.

Signed-off-by: default avatardramforever <dramforever@live.com>
Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
parent 187127fb
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment