summaryrefslogtreecommitdiff
path: root/lib/sbi_system.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-05-23 11:00:58 +0300
committerAnup Patel <anup@brainfault.org>2019-05-24 05:52:47 +0300
commita6395acd6cb2c35871481d3e4f0beaf449f8c0fd (patch)
tree4361c3454a814e49cea8f53d0a6cf3885e7f280b /lib/sbi_system.c
parentbb915780ac76b146f3de47f105a95359e02f158c (diff)
downloadopensbi-a6395acd6cb2c35871481d3e4f0beaf449f8c0fd.tar.xz
lib: Handle page/access fault caused by unpriv load/store
The unpriv load/store instruction from M-mode can cause page/access fault to M-mode if S-mode page table did not have mappings OR it did not have PMP access permission. To tackle this, we redirect trap back to S-mode if unpriv load/store instruction traps in M-mode. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi_system.c')
-rw-r--r--lib/sbi_system.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi_system.c b/lib/sbi_system.c
index 3381d40..2cb30d4 100644
--- a/lib/sbi_system.c
+++ b/lib/sbi_system.c
@@ -39,7 +39,7 @@ sbi_system_shutdown(struct sbi_scratch *scratch, u32 type)
/* If that fails (or is not implemented) send an IPI on every
* hart to hang and then hang the current hart */
- sbi_ipi_send_many(scratch, NULL, SBI_IPI_EVENT_HALT, NULL);
+ sbi_ipi_send_many(scratch, NULL, NULL, SBI_IPI_EVENT_HALT, NULL);
sbi_hart_hang();
}