mirror of https://github.com/xemu-project/xemu.git
target/riscv: Remove additional priv version check for mcountinhibit
With .min_priv_version, additiona priv version check is uncessary for mcountinhibit read/write functions. Reviewed-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Atish Patra <atishp@rivosinc.com> Message-Id: <20220816232321.558250-7-atishp@rivosinc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
25da6e3113
commit
240b363618
|
@ -1494,10 +1494,6 @@ static RISCVException write_mtvec(CPURISCVState *env, int csrno,
|
||||||
static RISCVException read_mcountinhibit(CPURISCVState *env, int csrno,
|
static RISCVException read_mcountinhibit(CPURISCVState *env, int csrno,
|
||||||
target_ulong *val)
|
target_ulong *val)
|
||||||
{
|
{
|
||||||
if (env->priv_ver < PRIV_VERSION_1_11_0) {
|
|
||||||
return RISCV_EXCP_ILLEGAL_INST;
|
|
||||||
}
|
|
||||||
|
|
||||||
*val = env->mcountinhibit;
|
*val = env->mcountinhibit;
|
||||||
return RISCV_EXCP_NONE;
|
return RISCV_EXCP_NONE;
|
||||||
}
|
}
|
||||||
|
@ -1508,10 +1504,6 @@ static RISCVException write_mcountinhibit(CPURISCVState *env, int csrno,
|
||||||
int cidx;
|
int cidx;
|
||||||
PMUCTRState *counter;
|
PMUCTRState *counter;
|
||||||
|
|
||||||
if (env->priv_ver < PRIV_VERSION_1_11_0) {
|
|
||||||
return RISCV_EXCP_ILLEGAL_INST;
|
|
||||||
}
|
|
||||||
|
|
||||||
env->mcountinhibit = val;
|
env->mcountinhibit = val;
|
||||||
|
|
||||||
/* Check if any other counter is also monitoring cycles/instructions */
|
/* Check if any other counter is also monitoring cycles/instructions */
|
||||||
|
|
Loading…
Reference in New Issue