[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 23/43] target/riscv: Remove misa_mxl validation
From: |
Alex Bennée |
Subject: |
[PATCH v2 23/43] target/riscv: Remove misa_mxl validation |
Date: |
Wed, 3 Jan 2024 17:33:29 +0000 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
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: <20231213-riscv-v7-2-a760156a337f@daynix.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/riscv/tcg/tcg-cpu.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/target/riscv/tcg/tcg-cpu.c b/target/riscv/tcg/tcg-cpu.c
index 8a35683a345..ee17f65afb6 100644
--- a/target/riscv/tcg/tcg-cpu.c
+++ b/target/riscv/tcg/tcg-cpu.c
@@ -148,7 +148,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);
CPUClass *cc = CPU_CLASS(mcc);
@@ -168,11 +168,6 @@ static void riscv_cpu_validate_misa_mxl(RISCVCPU *cpu,
Error **errp)
default:
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_priv_spec(RISCVCPU *cpu, Error **errp)
@@ -673,7 +668,6 @@ static bool riscv_cpu_is_generic(Object *cpu_obj)
static bool tcg_cpu_realize(CPUState *cs, Error **errp)
{
RISCVCPU *cpu = RISCV_CPU(cs);
- Error *local_err = NULL;
if (!riscv_cpu_tcg_compatible(cpu)) {
g_autofree char *name = riscv_cpu_get_name(cpu);
@@ -682,14 +676,11 @@ static bool tcg_cpu_realize(CPUState *cs, Error **errp)
return false;
}
- riscv_cpu_validate_misa_mxl(cpu, &local_err);
- if (local_err != NULL) {
- error_propagate(errp, local_err);
- return false;
- }
+ riscv_cpu_validate_misa_mxl(cpu);
#ifndef CONFIG_USER_ONLY
CPURISCVState *env = &cpu->env;
+ Error *local_err = NULL;
CPU(cs)->tcg_cflags |= CF_PCREL;
--
2.39.2
- Re: [PATCH v2 12/43] qtest: bump boot-serial-test timeout to 3 minutes, (continued)
- [PATCH v2 11/43] qtest: bump prom-env-test timeout to 6 minutes, Alex Bennée, 2024/01/03
- [PATCH v2 14/43] qtest: bump aspeed_smc-test timeout to 6 minutes, Alex Bennée, 2024/01/03
- [PATCH v2 15/43] qtest: bump bios-table-test timeout to 9 minutes, Alex Bennée, 2024/01/03
- [PATCH v2 32/43] gdbstub: Simplify XML lookup, Alex Bennée, 2024/01/03
- [PATCH v2 13/43] qtest: bump qos-test timeout to 2 minutes, Alex Bennée, 2024/01/03
- [PATCH v2 16/43] tests/qtest: Bump the device-introspect-test timeout to 12 minutes, Alex Bennée, 2024/01/03
- [PATCH v2 27/43] target/ppc: Use GDBFeature for dynamic XML, Alex Bennée, 2024/01/03
- [PATCH v2 31/43] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb, Alex Bennée, 2024/01/03
- [PATCH v2 23/43] target/riscv: Remove misa_mxl validation,
Alex Bennée <=
- [PATCH v2 28/43] target/riscv: Use GDBFeature for dynamic XML, Alex Bennée, 2024/01/03
- [PATCH v2 36/43] plugins: Use different helpers when reading registers, Alex Bennée, 2024/01/03
- [PATCH v2 20/43] mtest2make: stop disabling meson test timeouts, Alex Bennée, 2024/01/03
- [PATCH v2 22/43] hw/riscv: Use misa_mxl instead of misa_mxl_max, Alex Bennée, 2024/01/03
- [PATCH v2 39/43] contrib/plugins: fix imatch, Alex Bennée, 2024/01/03
- [PATCH v2 42/43] docs/devel: lift example and plugin API sections up, Alex Bennée, 2024/01/03