[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/8] target/riscv: use isa_ext_update_enabled() in init_max_cpu_e
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH 6/8] target/riscv: use isa_ext_update_enabled() in init_max_cpu_extensions() |
Date: |
Fri, 28 Jul 2023 10:15:18 -0300 |
Before adding support to detect if an extension was user set we need to
handle how we're enabling extensions in riscv_init_max_cpu_extensions().
object_property_set_bool() calls the set() callback for the property,
and we're going to use this callback to set the 'multi_ext_user_opts'
hash.
This means that, as is today, all extensions we're setting for the 'max'
CPU will be seen as user set in the future. Let's change set_bool() to
isa_ext_update_enabled() that will just enable/disable the flag on a
certain offset.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
target/riscv/cpu.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index b588f6969f..a40dc865a0 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -2096,25 +2096,24 @@ static void riscv_init_max_cpu_extensions(Object *obj)
set_misa(env, env->misa_mxl, env->misa_ext | RVG | RVJ | RVV);
for (int i = 0; i < ARRAY_SIZE(riscv_cpu_extensions); i++) {
- object_property_set_bool(obj, riscv_cpu_extensions[i].name,
- true, NULL);
+ isa_ext_update_enabled(cpu, riscv_cpu_extensions[i].offset, true);
}
/* set vector version */
env->vext_ver = VEXT_VERSION_1_00_0;
/* Zfinx is not compatible with F. Disable it */
- object_property_set_bool(obj, "zfinx", false, NULL);
- object_property_set_bool(obj, "zdinx", false, NULL);
- object_property_set_bool(obj, "zhinx", false, NULL);
- object_property_set_bool(obj, "zhinxmin", false, NULL);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zfinx), false);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zdinx), false);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zhinx), false);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zhinxmin), false);
- object_property_set_bool(obj, "zce", false, NULL);
- object_property_set_bool(obj, "zcmp", false, NULL);
- object_property_set_bool(obj, "zcmt", false, NULL);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zce), false);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zcmp), false);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zcmt), false);
if (env->misa_mxl != MXL_RV32) {
- object_property_set_bool(obj, "zcf", false, NULL);
+ isa_ext_update_enabled(cpu, CPU_CFG_OFFSET(ext_zcf), false);
}
}
--
2.41.0
- [PATCH 0/8] riscv: detecting user choice in TCG extensions, Daniel Henrique Barboza, 2023/07/28
- [PATCH 4/8] target/riscv/cpu.c: use cpu_cfg_ext_auto_update() during realize(), Daniel Henrique Barboza, 2023/07/28
- [PATCH 1/8] target/riscv/cpu.c: use offset in isa_ext_is_enabled/update_enabled, Daniel Henrique Barboza, 2023/07/28
- [PATCH 2/8] target/riscv: make CPUCFG() macro public, Daniel Henrique Barboza, 2023/07/28
- [PATCH 3/8] target/riscv/cpu.c: introduce cpu_cfg_ext_auto_update(), Daniel Henrique Barboza, 2023/07/28
- [PATCH 7/8] target/riscv/cpu.c: honor user choice in cpu_cfg_ext_auto_update(), Daniel Henrique Barboza, 2023/07/28
- [PATCH 8/8] target/riscv/cpu.c: consider user option with RVG, Daniel Henrique Barboza, 2023/07/28
- [PATCH 6/8] target/riscv: use isa_ext_update_enabled() in init_max_cpu_extensions(),
Daniel Henrique Barboza <=
- [PATCH 5/8] target/riscv/cpu.c: introduce RISCVCPUMultiExtConfig, Daniel Henrique Barboza, 2023/07/28