[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 09/20] target/riscv/cpu.c: limit cfg->vext_spec log message
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v10 09/20] target/riscv/cpu.c: limit cfg->vext_spec log message |
Date: |
Tue, 12 Sep 2023 10:24:12 -0300 |
Inside riscv_cpu_validate_v() we're always throwing a log message if the
user didn't set a vector version via 'vext_spec'.
We're going to include one case with the 'max' CPU where env->vext_ver
will be set in the cpu_init(). But that alone will not stop the "vector
version is not specified" message from appearing. The usefulness of this
log message is debatable for the generic CPUs, but for a 'max' CPU type,
where we are supposed to deliver a CPU model with all features possible,
it's strange to force users to set 'vext_spec' to get rid of this
message.
Change riscv_cpu_validate_v() to not throw this log message if
env->vext_ver is already set.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
---
target/riscv/cpu.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 15df29580c..292928fcef 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -959,8 +959,6 @@ static void riscv_cpu_disas_set_info(CPUState *s,
disassemble_info *info)
static void riscv_cpu_validate_v(CPURISCVState *env, RISCVCPUConfig *cfg,
Error **errp)
{
- int vext_version = VEXT_VERSION_1_00_0;
-
if (!is_power_of_2(cfg->vlen)) {
error_setg(errp, "Vector extension VLEN must be power of 2");
return;
@@ -983,17 +981,18 @@ static void riscv_cpu_validate_v(CPURISCVState *env,
RISCVCPUConfig *cfg,
}
if (cfg->vext_spec) {
if (!g_strcmp0(cfg->vext_spec, "v1.0")) {
- vext_version = VEXT_VERSION_1_00_0;
+ env->vext_ver = VEXT_VERSION_1_00_0;
} else {
error_setg(errp, "Unsupported vector spec version '%s'",
cfg->vext_spec);
return;
}
- } else {
+ } else if (env->vext_ver == 0) {
qemu_log("vector version is not specified, "
"use the default value v1.0\n");
+
+ env->vext_ver = VEXT_VERSION_1_00_0;
}
- env->vext_ver = vext_version;
}
static void riscv_cpu_validate_priv_spec(RISCVCPU *cpu, Error **errp)
--
2.41.0
- [PATCH v10 00/20] riscv: 'max' CPU, detect user choice in TCG, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 02/20] target/riscv/cpu.c: skip 'bool' check when filtering KVM props, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 01/20] target/riscv/cpu.c: split CPU options from riscv_cpu_extensions[], Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 07/20] target/riscv/cpu.c: add riscv_cpu_add_qdev_prop_array(), Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 04/20] target/riscv: add DEFINE_PROP_END_OF_LIST() to riscv_cpu_options[], Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 05/20] target/riscv/cpu.c: split non-ratified exts from riscv_cpu_extensions[], Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 06/20] target/riscv/cpu.c: split vendor exts from riscv_cpu_extensions[], Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 03/20] target/riscv/cpu.c: split kvm prop handling to its own helper, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 08/20] target/riscv/cpu.c: add riscv_cpu_add_kvm_unavail_prop_array(), Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 09/20] target/riscv/cpu.c: limit cfg->vext_spec log message,
Daniel Henrique Barboza <=
- [PATCH v10 10/20] target/riscv: add 'max' CPU type, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 11/20] avocado, risc-v: add tuxboot tests for 'max' CPU, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 12/20] target/riscv: deprecate the 'any' CPU type, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 13/20] target/riscv/cpu.c: use offset in isa_ext_is_enabled/update_enabled, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 14/20] target/riscv: make CPUCFG() macro public, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 15/20] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_update(), Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 17/20] target/riscv/cpu.c: introduce RISCVCPUMultiExtConfig, Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 16/20] target/riscv/cpu.c: use cpu_cfg_ext_auto_update() during realize(), Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 18/20] target/riscv: use isa_ext_update_enabled() in init_max_cpu_extensions(), Daniel Henrique Barboza, 2023/09/12
- [PATCH v10 19/20] target/riscv/cpu.c: honor user choice in cpu_cfg_ext_auto_update(), Daniel Henrique Barboza, 2023/09/12