target/riscv: Remove misa_mxl validation
It is initialized with a simple assignment and there is little room for error. In fact, the validation is even more complex. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Acked-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Acked-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20240203-riscv-v11-1-a23f4848a628@daynix.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
6f4a6248bb
commit
0e350c1ada
@ -268,7 +268,7 @@ static void riscv_cpu_validate_misa_priv(CPURISCVState *env, Error **errp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp)
|
static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu)
|
||||||
{
|
{
|
||||||
RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu);
|
RISCVCPUClass *mcc = RISCV_CPU_GET_CLASS(cpu);
|
||||||
CPUClass *cc = CPU_CLASS(mcc);
|
CPUClass *cc = CPU_CLASS(mcc);
|
||||||
@ -288,11 +288,6 @@ static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu, Error **errp)
|
|||||||
default:
|
default:
|
||||||
g_assert_not_reached();
|
g_assert_not_reached();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env->misa_mxl_max != env->misa_mxl) {
|
|
||||||
error_setg(errp, "misa_mxl_max must be equal to misa_mxl");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void riscv_cpu_validate_v(CPURISCVState *env, RISCVCPUConfig *cfg,
|
static void riscv_cpu_validate_v(CPURISCVState *env, RISCVCPUConfig *cfg,
|
||||||
@ -908,7 +903,6 @@ static bool riscv_cpu_is_generic(Object *cpu_obj)
|
|||||||
static bool riscv_tcg_cpu_realize(CPUState *cs, Error **errp)
|
static bool riscv_tcg_cpu_realize(CPUState *cs, Error **errp)
|
||||||
{
|
{
|
||||||
RISCVCPU *cpu = RISCV_CPU(cs);
|
RISCVCPU *cpu = RISCV_CPU(cs);
|
||||||
Error *local_err = NULL;
|
|
||||||
|
|
||||||
if (!riscv_cpu_tcg_compatible(cpu)) {
|
if (!riscv_cpu_tcg_compatible(cpu)) {
|
||||||
g_autofree char *name = riscv_cpu_get_name(cpu);
|
g_autofree char *name = riscv_cpu_get_name(cpu);
|
||||||
@ -917,14 +911,11 @@ static bool riscv_tcg_cpu_realize(CPUState *cs, Error **errp)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
riscv_cpu_validate_misa_mxl(cpu, &local_err);
|
riscv_cpu_validate_misa_mxl(cpu);
|
||||||
if (local_err != NULL) {
|
|
||||||
error_propagate(errp, local_err);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
CPURISCVState *env = &cpu->env;
|
CPURISCVState *env = &cpu->env;
|
||||||
|
Error *local_err = NULL;
|
||||||
|
|
||||||
CPU(cs)->tcg_cflags |= CF_PCREL;
|
CPU(cs)->tcg_cflags |= CF_PCREL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user