aboutsummaryrefslogtreecommitdiff
path: root/target/riscv/cpu.h
diff options
context:
space:
mode:
authorMayuresh Chitale <mchitale@ventanamicro.com>2022-10-16 18:17:22 +0530
committerAlistair Francis <alistair.francis@wdc.com>2023-01-06 10:42:55 +1000
commit3bee0e40106df7926e38464d0e9f34a57a0a01ad (patch)
tree14569db98c7c1bb0692c6e296522125cde71fd35 /target/riscv/cpu.h
parentaefd1108ee8efe4a11fafdaf03c593b8b953aa4e (diff)
downloadqemu-3bee0e40106df7926e38464d0e9f34a57a0a01ad.zip
qemu-3bee0e40106df7926e38464d0e9f34a57a0a01ad.tar.gz
qemu-3bee0e40106df7926e38464d0e9f34a57a0a01ad.tar.bz2
target/riscv: Add smstateen support
Smstateen extension specifies a mechanism to close the potential covert channels that could cause security issues. This patch adds the CSRs defined in the specification and the corresponding predicates and read/write functions. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20221016124726.102129-2-mchitale@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/cpu.h')
-rw-r--r--target/riscv/cpu.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 443d15a..5cac0c5 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -366,6 +366,9 @@ struct CPUArchState {
/* CSRs for execution enviornment configuration */
uint64_t menvcfg;
+ uint64_t mstateen[SMSTATEEN_MAX_COUNT];
+ uint64_t hstateen[SMSTATEEN_MAX_COUNT];
+ uint64_t sstateen[SMSTATEEN_MAX_COUNT];
target_ulong senvcfg;
uint64_t henvcfg;
#endif
@@ -441,6 +444,7 @@ struct RISCVCPUConfig {
bool ext_ifencei;
bool ext_icsr;
bool ext_zihintpause;
+ bool ext_smstateen;
bool ext_sstc;
bool ext_svinval;
bool ext_svnapot;