summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-08-12 09:20:22 +0300
committerAnup Patel <anup.patel@wdc.com>2019-08-13 07:18:40 +0300
commita88e424f6c3a42a38e9395726d9fd4e50a96abd2 (patch)
tree74804eabd44a8007c7a3a1ea62f710d68af53fbd /include
parent2e0f3ac758da99fb6d1b4c651643999d83cd0a7f (diff)
downloadopensbi-a88e424f6c3a42a38e9395726d9fd4e50a96abd2.tar.xz
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>
Diffstat (limited to 'include')
-rw-r--r--include/sbi/riscv_unpriv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sbi/riscv_unpriv.h b/include/sbi/riscv_unpriv.h
index 0fad27d..ebd0fe3 100644
--- a/include/sbi/riscv_unpriv.h
+++ b/include/sbi/riscv_unpriv.h
@@ -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