[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 22/40] target/riscv: Remove misa_mxl validation
From: |
Alex Bennée |
Subject: |
[PATCH 22/40] target/riscv: Remove misa_mxl validation |
Date: |
Thu, 21 Dec 2023 10:38:00 +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
- [PATCH 13/40] qtest: bump qos-test timeout to 2 minutes, (continued)
- [PATCH 13/40] qtest: bump qos-test timeout to 2 minutes, Alex Bennée, 2023/12/21
- [PATCH 12/40] qtest: bump boot-serial-test timeout to 3 minutes, Alex Bennée, 2023/12/21
- [PATCH 19/40] tests/fp: Bump fp-test-mulAdd test timeout to 3 minutes, Alex Bennée, 2023/12/21
- [PATCH 15/40] qtest: bump bios-table-test timeout to 9 minutes, Alex Bennée, 2023/12/21
- [PATCH 09/40] qtest: bump test-hmp timeout to 4 minutes, Alex Bennée, 2023/12/21
- [PATCH 39/40] contrib/plugins: extend execlog to track register changes, Alex Bennée, 2023/12/21
- [PATCH 36/40] gdbstub: expose api to find registers, Alex Bennée, 2023/12/21
- [PATCH 37/40] plugins: add an API to read registers, Alex Bennée, 2023/12/21
- [PATCH 38/40] contrib/plugins: fix imatch, Alex Bennée, 2023/12/21
- [PATCH 40/40] contrib/plugins: optimise the register value tracking, Alex Bennée, 2023/12/21
- [PATCH 22/40] target/riscv: Remove misa_mxl validation,
Alex Bennée <=
- [PATCH 23/40] target/riscv: Move misa_mxl_max to class, Alex Bennée, 2023/12/21
- [PATCH 25/40] target/arm: Use GDBFeature for dynamic XML, Alex Bennée, 2023/12/21
- [PATCH 27/40] target/riscv: Use GDBFeature for dynamic XML, Alex Bennée, 2023/12/21
- [PATCH 33/40] hw/core/cpu: Remove gdb_get_dynamic_xml member, Alex Bennée, 2023/12/21
- [PATCH 32/40] gdbstub: Infer number of core registers from XML, Alex Bennée, 2023/12/21
- [PATCH 35/40] plugins: Use different helpers when reading registers, Alex Bennée, 2023/12/21
- [PATCH 24/40] target/riscv: Validate misa_mxl_max only once, Alex Bennée, 2023/12/21
- [PATCH 31/40] gdbstub: Simplify XML lookup, Alex Bennée, 2023/12/21
- [PATCH 26/40] target/ppc: Use GDBFeature for dynamic XML, Alex Bennée, 2023/12/21
- [PATCH 16/40] tests/qtest: Bump the device-introspect-test timeout to 12 minutes, Alex Bennée, 2023/12/21