target/riscv: Fix VS mode hypervisor CSR access
authorDylan Reid <dylan@rivosinc.com>
Fri, 6 May 2022 16:54:57 +0000 (16:54 +0000)
committerAlistair Francis <alistair.francis@wdc.com>
Mon, 23 May 2022 23:48:20 +0000 (09:48 +1000)
commitd6cd3ae0ebdfab9922f932dc303e1faa618ea547
treeff9c09223cdce27f7a79b561c7a5d3dca5811ed0
parent3757b0d08b399c609954cf57f273b1167e5d7a8d
target/riscv: Fix VS mode hypervisor CSR access

VS mode access to hypervisor CSRs should generate virtual, not illegal,
instruction exceptions.

Don't return early and indicate an illegal instruction exception when
accessing a hypervisor CSR from VS mode. Instead, fall through to the
`hmode` predicate to return the correct virtual instruction exception.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20220506165456.297058-1-dgreid@rivosinc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/csr.c