target/riscv: smstateen check for h/s/envcfg
authorMayuresh Chitale <mchitale@ventanamicro.com>
Sun, 16 Oct 2022 12:47:23 +0000 (18:17 +0530)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 6 Jan 2023 00:42:55 +0000 (10:42 +1000)
commit252b06f638cdc79aa6dc33e91174b276eb69b3e0
tree8c3ce3ffb0ed3fb9896d4118de252b90ce047391
parent3bee0e40106df7926e38464d0e9f34a57a0a01ad
target/riscv: smstateen check for h/s/envcfg

Accesses to henvcfg, henvcfgh and senvcfg are allowed only if the corresponding
bit in mstateen0/hstateen0 is enabled. Otherwise an illegal instruction trap is
generated.

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-3-mchitale@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/csr.c