[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 16/20] target/riscv/cpu.c: remove priv_ver check from riscv_is
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v7 16/20] target/riscv/cpu.c: remove priv_ver check from riscv_isa_string_ext() |
Date: |
Fri, 30 Jun 2023 07:08:07 -0300 |
riscv_isa_string_ext() is being used by riscv_isa_string(), which is
then used by boards to retrieve the 'riscv,isa' string to be written in
the FDT. All this happens after riscv_cpu_realize(), meaning that we're
already past riscv_cpu_validate_set_extensions() and, more important,
riscv_cpu_disable_priv_spec_isa_exts().
This means that all extensions that needed to be disabled due to
priv_spec mismatch are already disabled. Checking this again during
riscv_isa_string_ext() is unneeded. Remove it.
As a bonus, riscv_isa_string_ext() can now be used with the 'host'
KVM-only CPU type since it doesn't have a env->priv_ver assigned and it
would fail this check for no good reason.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
---
target/riscv/cpu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index db718eff65..6cdcbaac30 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -2042,8 +2042,7 @@ static void riscv_isa_string_ext(RISCVCPU *cpu, char
**isa_str,
int i;
for (i = 0; i < ARRAY_SIZE(isa_edata_arr); i++) {
- if (cpu->env.priv_ver >= isa_edata_arr[i].min_version &&
- isa_ext_is_enabled(cpu, &isa_edata_arr[i])) {
+ if (isa_ext_is_enabled(cpu, &isa_edata_arr[i])) {
new = g_strconcat(old, "_", isa_edata_arr[i].name, NULL);
g_free(old);
old = new;
--
2.41.0
- [PATCH v7 07/20] target/riscv: read marchid/mimpid in kvm_riscv_init_machine_ids(), (continued)
- [PATCH v7 07/20] target/riscv: read marchid/mimpid in kvm_riscv_init_machine_ids(), Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 08/20] target/riscv: handle mvendorid/marchid/mimpid for KVM CPUs, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 09/20] linux-headers: Update to v6.4-rc1, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 10/20] target/riscv/kvm.c: init 'misa_ext_mask' with scratch CPU, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 12/20] target/riscv: add KVM specific MISA properties, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 11/20] target/riscv/cpu: add misa_ext_info_arr[], Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 15/20] target/riscv/cpu.c: add satp_mode properties earlier, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 13/20] target/riscv/kvm.c: update KVM MISA bits, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 14/20] target/riscv/kvm.c: add multi-letter extension KVM properties, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 16/20] target/riscv/cpu.c: remove priv_ver check from riscv_isa_string_ext(),
Daniel Henrique Barboza <=
- [PATCH v7 17/20] target/riscv/cpu.c: create KVM mock properties, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 18/20] target/riscv: update multi-letter extension KVM properties, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 19/20] target/riscv/kvm.c: add kvmconfig_get_cfg_addr() helper, Daniel Henrique Barboza, 2023/06/30
- [PATCH v7 20/20] target/riscv/kvm.c: read/write (cbom|cboz)_blocksize in KVM, Daniel Henrique Barboza, 2023/06/30