[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240409061043.3269676-4-debug@rivosinc.com>
Date: Mon, 8 Apr 2024 23:10:34 -0700
From: Deepak Gupta <debug@...osinc.com>
To: linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev
Cc: paul.walmsley@...ive.com,
palmer@...belt.com,
aou@...s.berkeley.edu,
nathan@...nel.org,
ndesaulniers@...gle.com,
morbo@...gle.com,
justinstitt@...gle.com,
andy.chiu@...ive.com,
debug@...osinc.com,
hankuan.chen@...ive.com,
guoren@...nel.org,
greentime.hu@...ive.com,
samitolvanen@...gle.com,
cleger@...osinc.com,
apatel@...tanamicro.com,
ajones@...tanamicro.com,
conor.dooley@...rochip.com,
mchitale@...tanamicro.com,
dbarboza@...tanamicro.com,
waylingii@...il.com,
sameo@...osinc.com,
alexghiti@...osinc.com,
akpm@...ux-foundation.org,
shikemeng@...weicloud.com,
rppt@...nel.org,
charlie@...osinc.com,
xiao.w.wang@...el.com,
willy@...radead.org,
jszhang@...nel.org,
leobras@...hat.com,
songshuaishuai@...ylab.org,
haxel@....de,
samuel.holland@...ive.com,
namcaov@...il.com,
bjorn@...osinc.com,
cuiyunhui@...edance.com,
wangkefeng.wang@...wei.com,
falcon@...ylab.org,
viro@...iv.linux.org.uk,
bhe@...hat.com,
chenjiahao16@...wei.com,
hca@...ux.ibm.com,
arnd@...db.de,
kent.overstreet@...ux.dev,
boqun.feng@...il.com,
oleg@...hat.com,
paulmck@...nel.org,
broonie@...nel.org,
rick.p.edgecombe@...el.com
Subject: [RFC PATCH 03/12] riscv: after saving expected landing pad (elp), clear elp state
On trap entry, save expected landing pad state and subsequently clear it
in sstatus so that if there are traps later on in kernel and sret happens
back to same mode, cpu will start faulting.
Signed-off-by: Deepak Gupta <debug@...osinc.com>
---
arch/riscv/kernel/entry.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index 68a24cf9481a..be07355b9eff 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -56,7 +56,7 @@ SYM_CODE_START(handle_exception)
* Disable the FPU/Vector to detect illegal usage of floating point
* or vector in kernel space.
*/
- li t0, SR_SUM | SR_FS_VS
+ li t0, SR_SUM | SR_FS_VS | SR_ELP
REG_L s0, TASK_TI_USER_SP(tp)
csrrc s1, CSR_STATUS, t0
--
2.43.2
Powered by blists - more mailing lists