PRV_H has no real meaning, but just a reserved privilege mode currently.
Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <
20230407014743.18779-3-liweiwei@iscas.ac.cn>
[ Changes by AF:
- Convert one missing use of PRV_H
]
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
case PRV_U:
xl = get_field(env->mstatus, MSTATUS64_UXL);
break;
- default: /* PRV_S | PRV_H */
+ default: /* PRV_S */
xl = get_field(env->mstatus, MSTATUS64_SXL);
break;
}
/* Privilege modes */
#define PRV_U 0
#define PRV_S 1
-#define PRV_H 2 /* Reserved */
+#define PRV_RESERVED 2
#define PRV_M 3
/* RV32 satp CSR field masks */
if (newpriv > PRV_M) {
g_assert_not_reached();
}
- if (newpriv == PRV_H) {
+ if (newpriv == PRV_RESERVED) {
newpriv = PRV_U;
}
if (icount_enabled() && newpriv != env->priv) {
if (n == 0) {
#ifndef CONFIG_USER_ONLY
cs->priv = ldtul_p(mem_buf) & 0x3;
- if (cs->priv == PRV_H) {
+ if (cs->priv == PRV_RESERVED) {
cs->priv = PRV_S;
}
#endif
}
if (env->virt_enabled &&
- (((env->priv < PRV_H) && !get_field(env->henvcfg, envbits)) ||
+ (((env->priv <= PRV_S) && !get_field(env->henvcfg, envbits)) ||
((env->priv < PRV_S) && !get_field(env->senvcfg, envbits)))) {
riscv_raise_exception(env, RISCV_EXCP_VIRT_INSTRUCTION_FAULT, ra);
}