On 6/22/2026 6:13 PM, Philippe Mathieu-Daudé wrote:
On 22/6/26 21:31, Daniel Henrique Barboza wrote:
We have a lot of TCG only initialization in the common cpu_reset_hold
callback that prevents --disable-tcg to work.

Put a CONFIG_TCG ifdef around those bits to make the build work.
Eventually we'll create a TCG specific reset function in tcg-cpu.c but
for now this suffices.

Signed-off-by: Daniel Henrique Barboza <[email protected]>
---
  target/riscv/cpu.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)


@@ -1013,6 +1009,10 @@ static void riscv_cpu_reset_hold(Object *obj, ResetType 
type)
                      MENVCFG_ADUE : 0);
      env->henvcfg = 0;
+#ifdef CONFIG_TCG
+    uint8_t iprio;
+    int i, irq, rdzero;
+
      /* Initialized default priorities of local interrupts. */
      for (i = 0; i < ARRAY_SIZE(env->miprio); i++) {
          iprio = riscv_cpu_default_priority(i);
@@ -1050,11 +1050,12 @@ static void riscv_cpu_reset_hold(Object *obj, ResetType 
type)
      }
      pmp_unlock_entries(env);
+#endif /* ifdef CONFIG_TCG */
  #else
      env->priv = PRV_U;
      env->senvcfg = 0;
      env->menvcfg = 0;
-#endif
+#endif /* ifndef CONFIG_USER_ONLY */

   /* !CONFIG_USER_ONLY */

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

Phil I forgot about this ack. My bad :(


I'll make sure to add update it in v3.  Cheers,

Daniel




Reply via email to