Skip to contentSkip to conversation

target/arm: Restrict arm_do_plugin_vcpu_discon_cb() to TCG

PATCH Applied Philippe Mathieu-Daudé 3 participants 6 messages Aug 14 – Aug 15

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: Restrict arm_do_plugin_vcpu_discon_cb() to TCG

So far TCG plugins can only be used when TCG is available. Move the arm_do_plugin_vcpu_discon_cb() call within the 'if tcg_enabled' block and wrap the definition with #ifdef'ry.

---
 target/arm/helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
target/arm/helper.c +4 -2
index af45234ad2a..adae2b2b8e5 100644
@@ -8915,6 +8915,7 @@ static void take_aarch32_exception(CPUARMState *env, int new_mode,
     }
 }
 
+#ifdef CONFIG_TCG
 void arm_do_plugin_vcpu_discon_cb(CPUState *cs, uint64_t from)
 {
     switch (cs->exception_index) {
@@ -8932,6 +8933,7 @@ void arm_do_plugin_vcpu_discon_cb(CPUState *cs, uint64_t from)
         qemu_plugin_vcpu_exception_cb(cs, from);
     }
 }
+#endif
 
 static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs)
 {
@@ -9677,9 +9679,9 @@ void arm_cpu_do_interrupt(CPUState *cs)
 
     if (tcg_enabled()) {
         cpu_set_interrupt(cs, CPU_INTERRUPT_EXITTB);
-    }
 
-    arm_do_plugin_vcpu_discon_cb(cs, last_pc);
+        arm_do_plugin_vcpu_discon_cb(cs, last_pc);
+    }
 }
 #endif /* !CONFIG_USER_ONLY */
 
Signature · 1 line
2.53.0
#1 lore raw
Quoted 6 lines · Philippe Mathieu-Daudé

So far TCG plugins can only be used when TCG is available. Move the arm_do_plugin_vcpu_discon_cb() call within the 'if tcg_enabled' block and wrap the definition with #ifdef'ry.

---

BTW luckily, except PPC, all other targets with HW accelerator support already have this restricted to TCG (X86, LoongArch, RISCV, S390x). Since I'm only testing hybrid acceleration on ARM I don't have the need to do the equivalent cleanup on PPC.

Quoted 35 lines
  target/arm/helper.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
target/arm/helper.c +4 -2
index af45234ad2a..adae2b2b8e5 100644
@@ -8915,6 +8915,7 @@ static void take_aarch32_exception(CPUARMState *env, int new_mode,
      }
  }
 
+#ifdef CONFIG_TCG
  void arm_do_plugin_vcpu_discon_cb(CPUState *cs, uint64_t from)
  {
      switch (cs->exception_index) {
@@ -8932,6 +8933,7 @@ void arm_do_plugin_vcpu_discon_cb(CPUState *cs, uint64_t from)
          qemu_plugin_vcpu_exception_cb(cs, from);
      }
  }
+#endif
 
  static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs)
  {
@@ -9677,9 +9679,9 @@ void arm_cpu_do_interrupt(CPUState *cs)
 
      if (tcg_enabled()) {
          cpu_set_interrupt(cs, CPU_INTERRUPT_EXITTB);
-    }
 
-    arm_do_plugin_vcpu_discon_cb(cs, last_pc);
+        arm_do_plugin_vcpu_discon_cb(cs, last_pc);
+    }
  }
  #endif /* !CONFIG_USER_ONLY */
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 9 lines · Philippe Mathieu-Daudé

So far TCG plugins can only be used when TCG is available. Move the arm_do_plugin_vcpu_discon_cb() call within the 'if tcg_enabled' block and wrap the definition with #ifdef'ry.

---
 target/arm/helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
#3 lore raw
Quoted 5 lines · Pierrick Bouvier
Quoted 4 lines · Philippe Mathieu-Daudé

So far TCG plugins can only be used when TCG is available. Move the arm_do_plugin_vcpu_discon_cb() call within the 'if tcg_enabled' block and wrap the definition with #ifdef'ry.

Quoted 7 lines
Quoted 5 lines
---
 target/arm/helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

I'll let Peter pull this, even if related to plugins, it belongs to target/arm.

Regards,
Pierrick

#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 6 lines · Philippe Mathieu-Daudé

So far TCG plugins can only be used when TCG is available. Move the arm_do_plugin_vcpu_discon_cb() call within the 'if tcg_enabled' block and wrap the definition with #ifdef'ry.

Applied to target-arm.next, thanks.

Does this fix any user-facing issue, or is it just something we need to sort out for hybrid acceleration ?

-- PMM

#5 lore raw
Quoted 7 lines · Peter Maydell
Quoted 5 lines · Philippe Mathieu-Daudé

So far TCG plugins can only be used when TCG is available. Move the arm_do_plugin_vcpu_discon_cb() call within the 'if tcg_enabled' block and wrap the definition with #ifdef'ry.

Quoted 6 lines
Quoted 1 line

Applied to target-arm.next, thanks.

Does this fix any user-facing issue, or is it just something we need to sort out for hybrid acceleration ?

Not an user-facing issue so far, but will emerge soon (the hybrid-accel series is too big and hard to split, I am trying to split unasorted cleanups of to reduce its size).