forked from Mirrors/opensbi
lib: Handle traps when doing unpriv load/store in get_insn()
We can get a page/access trap when doing unpriv load/store in get_insn() function because on a SMP system Linux swapper running on HART A can unmap pages from page table used by HART B. To tackle this we extend get_insn() implementation so that if we get trap in get_insn() then we redirect it to S-mode as fetch page/access fault. Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -43,6 +43,7 @@ DECLARE_UNPRIVILEGED_LOAD_FUNCTION(u64)
|
||||
DECLARE_UNPRIVILEGED_STORE_FUNCTION(u64)
|
||||
DECLARE_UNPRIVILEGED_LOAD_FUNCTION(ulong)
|
||||
|
||||
ulong get_insn(ulong mepc, ulong *mstatus);
|
||||
ulong get_insn(ulong mepc, struct sbi_scratch *scratch,
|
||||
struct unpriv_trap *trap);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user