]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: save and restore elp state on priv transitions
authorDeepak Gupta <debug@rivosinc.com>
Tue, 8 Oct 2024 22:49:54 +0000 (15:49 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 30 Oct 2024 01:22:08 +0000 (11:22 +1000)
commit53309be15619096b4ff2f05ec5e5d9b9bb6b6a82
tree26059a7f829b82acee9d6e1a2bc67e71195e7f83
parent4923f672e3d751cd8b7a10e32e09328c8f85ba1d
target/riscv: save and restore elp state on priv transitions

elp state is recorded in *status on trap entry (less privilege to higher
privilege) and restored in elp from *status on trap exit (higher to less
privilege).

Additionally this patch introduces a forward cfi helper function to
determine if current privilege has forward cfi is enabled or not based on
*envcfg (for U, VU, S, VU, HS) or mseccfg csr (for M).

Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Co-developed-by: Jim Shu <jim.shu@sifive.com>
Co-developed-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20241008225010.1861630-5-debug@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.h
target/riscv/cpu_helper.c
target/riscv/op_helper.c