[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v13 21/26] target/riscv/cpu.c: finalize satp_mode earlier
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v13 21/26] target/riscv/cpu.c: finalize satp_mode earlier |
Date: |
Mon, 18 Dec 2023 09:53:29 -0300 |
Profiles will need to validate satp_mode during their own finalize
methods. This will occur inside riscv_tcg_cpu_finalize_features() for
TCG. Given that satp_mode does not have any pre-req from the accelerator
finalize() method, it's safe to finalize it earlier.
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
---
target/riscv/cpu.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 1ba85c6d1c..6af1148cf5 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -1056,6 +1056,14 @@ void riscv_cpu_finalize_features(RISCVCPU *cpu, Error
**errp)
{
Error *local_err = NULL;
+#ifndef CONFIG_USER_ONLY
+ riscv_cpu_satp_mode_finalize(cpu, &local_err);
+ if (local_err != NULL) {
+ error_propagate(errp, local_err);
+ return;
+ }
+#endif
+
/*
* KVM accel does not have a specialized finalize()
* callback because its extensions are validated
@@ -1068,14 +1076,6 @@ void riscv_cpu_finalize_features(RISCVCPU *cpu, Error
**errp)
return;
}
}
-
-#ifndef CONFIG_USER_ONLY
- riscv_cpu_satp_mode_finalize(cpu, &local_err);
- if (local_err != NULL) {
- error_propagate(errp, local_err);
- return;
- }
-#endif
}
static void riscv_cpu_realize(DeviceState *dev, Error **errp)
--
2.43.0
- [PATCH v13 10/26] target/riscv/tcg: add user flag for profile support, (continued)
- [PATCH v13 10/26] target/riscv/tcg: add user flag for profile support, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 11/26] target/riscv/tcg: add MISA user options hash, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 12/26] target/riscv/tcg: add riscv_cpu_write_misa_bit(), Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 13/26] target/riscv/tcg: handle profile MISA bits, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 14/26] target/riscv/tcg: add hash table insert helpers, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 15/26] target/riscv/tcg: honor user choice for G MISA bits, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 16/26] target/riscv/tcg: validate profiles during finalize, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 17/26] riscv-qmp-cmds.c: add profile flags in cpu-model-expansion, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 18/26] target/riscv: add 'rva22u64' CPU, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 19/26] target/riscv: implement svade, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 21/26] target/riscv/cpu.c: finalize satp_mode earlier,
Daniel Henrique Barboza <=
- [PATCH v13 22/26] target/riscv/cpu.c: add riscv_cpu_is_32bit(), Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 20/26] target/riscv: add priv ver restriction to profiles, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 23/26] target/riscv: add satp_mode profile support, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 24/26] target/riscv: add 'parent' in profile description, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 25/26] target/riscv: add RVA22S64 profile, Daniel Henrique Barboza, 2023/12/18
- [PATCH v13 26/26] target/riscv: add rva22s64 cpu, Daniel Henrique Barboza, 2023/12/18