[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/20] target/riscv: add 'max_features' CPU flag
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH 06/20] target/riscv: add 'max_features' CPU flag |
Date: |
Fri, 25 Aug 2023 10:08:39 -0300 |
The 'max' CPU type is being configured during init() time by enabling
all relevant extensions.
Instead of checking for 'max' CPU to enable all extensions, add a new
CPU cfg flag 'max_features' that can be used by any CPU during its
cpu_init() function. We'll check for it during post_init() time to
decide whether we should enable the maximum amount of features in the
current CPU instance.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
---
target/riscv/cpu.c | 2 ++
target/riscv/cpu_cfg.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index e2e8724dc2..c35d58c64b 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -424,6 +424,8 @@ static void riscv_max_cpu_init(Object *obj)
CPURISCVState *env = &cpu->env;
RISCVMXL mlx = MXL_RV64;
+ cpu->cfg.max_features = true;
+
#ifdef TARGET_RISCV32
mlx = MXL_RV32;
#endif
diff --git a/target/riscv/cpu_cfg.h b/target/riscv/cpu_cfg.h
index 0e6a0f245c..df723e697b 100644
--- a/target/riscv/cpu_cfg.h
+++ b/target/riscv/cpu_cfg.h
@@ -137,6 +137,7 @@ struct RISCVCPUConfig {
bool epmp;
bool debug;
bool misa_w;
+ bool max_features;
bool short_isa_string;
--
2.41.0
- [PATCH 01/20] target/riscv: introduce TCG AccelCPUClass, (continued)
- [PATCH 01/20] target/riscv: introduce TCG AccelCPUClass, Daniel Henrique Barboza, 2023/08/25
- [PATCH 02/20] target/riscv: move riscv_cpu_realize_tcg() to TCG::cpu_realizefn(), Daniel Henrique Barboza, 2023/08/25
- [PATCH 04/20] target/riscv: move riscv_tcg_ops to tcg-cpu.c, Daniel Henrique Barboza, 2023/08/25
- [PATCH 03/20] target/riscv: move riscv_cpu_validate_set_extensions() to tcg-cpu.c, Daniel Henrique Barboza, 2023/08/25
- [PATCH 05/20] target/riscv/cpu.c: add 'user_extension_properties' class prop, Daniel Henrique Barboza, 2023/08/25
- [PATCH 06/20] target/riscv: add 'max_features' CPU flag,
Daniel Henrique Barboza <=
- [PATCH 07/20] target/riscv/cpu.c: add .instance_post_init(), Daniel Henrique Barboza, 2023/08/25
- [PATCH 09/20] target/riscv/cpu.c: mark extensions arrays as 'const', Daniel Henrique Barboza, 2023/08/25
- [PATCH 08/20] target/riscv: move 'host' CPU declaration to kvm.c, Daniel Henrique Barboza, 2023/08/25
- [PATCH 10/20] target/riscv: move riscv_cpu_add_kvm_properties() to kvm.c, Daniel Henrique Barboza, 2023/08/25
- [PATCH 11/20] target/riscv: introduce KVM AccelCPUClass, Daniel Henrique Barboza, 2023/08/25