On 22/6/26 21:31, Daniel Henrique Barboza wrote:
We have a couple of CPUs that has a set of custom CSRs that uses TCG
specific APIs.  Move the related code to tcg-cpu.c and do not set
.custom_csrs if we're not in a TCG build.

What we'll end up doing, sooner or later, is punting all these CPUs to
tcg-cpu.c since they're all TCG specific and KVM has nothing to do with
them.  Another time.

Signed-off-by: Daniel Henrique Barboza <[email protected]>
---
  target/riscv/cpu.c         | 24 +++---------------------
  target/riscv/tcg/tcg-cpu.c | 21 +++++++++++++++++++++
  2 files changed, 24 insertions(+), 21 deletions(-)

Squashing:

-- >8 --
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 7582874c351..4e58a5daaba 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -570,7 +570,9 @@ typedef struct RISCVCPUDef {
     int32_t vext_spec;
     RISCVCPUConfig cfg;
     bool bare;
+#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY)
     const RISCVCSR *custom_csrs;
+#endif
 } RISCVCPUDef;

---

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>


Reply via email to