If VS field is off, accessing vector csr registers should raise an
illegal-instruction exception.
Signed-off-by: Frank Chang <frank.chang@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <
20211210075704.23951-12-frank.chang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
static RISCVException vs(CPURISCVState *env, int csrno)
{
if (env->misa_ext & RVV) {
+#if !defined(CONFIG_USER_ONLY)
+ if (!env->debugger && !riscv_cpu_vector_enabled(env)) {
+ return RISCV_EXCP_ILLEGAL_INST;
+ }
+#endif
return RISCV_EXCP_NONE;
}
return RISCV_EXCP_ILLEGAL_INST;