artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3356529
)
riscv: Clear SUM in SSTATUS for supervisor mode exceptions.
author
jsg
<jsg@openbsd.org>
Wed, 5 May 2021 01:24:57 +0000
(
01:24
+0000)
committer
jsg
<jsg@openbsd.org>
Wed, 5 May 2021 01:24:57 +0000
(
01:24
+0000)
From John Baldwin
753bcca440a4d2c95f48536b586131b84c0bb87e
in FreeBSD
ok kettenis@ mlarkin@
sys/arch/riscv64/riscv64/exception.S
patch
|
blob
|
history
diff --git
a/sys/arch/riscv64/riscv64/exception.S
b/sys/arch/riscv64/riscv64/exception.S
index
7d461ff
..
d8a7e3c
100644
(file)
--- a/
sys/arch/riscv64/riscv64/exception.S
+++ b/
sys/arch/riscv64/riscv64/exception.S
@@
-83,6
+83,11
@@
sd t0, (TF_SEPC)(sp)
csrr t0, sstatus
sd t0, (TF_SSTATUS)(sp)
+.if \el == 1
+ /* Disable user address access for supervisor mode exceptions. */
+ li t0, SSTATUS_SUM
+ csrc sstatus, t0
+.endif
csrr t0, stval
sd t0, (TF_STVAL)(sp)
csrr t0, scause