Skip to contentSkip to conversation

target/ppc: Disable goto_tb with architectural singlestep

PATCH In review Richard Henderson 3 participants 4 messages Jul 28, 2023 – Jul 31, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/ppc: Disable goto_tb with architectural singlestep

The change to use translator_use_goto_tb went too far, as the CF_SINGLE_STEP flag managed by the translator only handles gdb single stepping and not the architectural single stepping modeled in DisasContext.singlestep_enabled.

Fixes 6e9cc373ec5 ("target/ppc: Use translator_use_goto_tb")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1795

---
 target/ppc/translate.c | 3 +++
 1 file changed, 3 insertions(+)
target/ppc/translate.c +3 -0
index e6a0709066..74796ec7ba 100644
@@ -4175,6 +4175,9 @@ static void pmu_count_insns(DisasContext *ctx)
 
 static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
 {
+    if (unlikely(ctx->singlestep_enabled)) {
+        return false;
+    }
     return translator_use_goto_tb(&ctx->base, dest);
 }
 
Signature · 1 line
2.34.1
#1 lore raw

Cc qemu-stable.

Quoted 26 lines · Richard Henderson

The change to use translator_use_goto_tb went too far, as the CF_SINGLE_STEP flag managed by the translator only handles gdb single stepping and not the architectural single stepping modeled in DisasContext.singlestep_enabled.

Fixes 6e9cc373ec5 ("target/ppc: Use translator_use_goto_tb")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1795

---
  target/ppc/translate.c | 3 +++
  1 file changed, 3 insertions(+)
target/ppc/translate.c +3 -0
index e6a0709066..74796ec7ba 100644
@@ -4175,6 +4175,9 @@ static void pmu_count_insns(DisasContext *ctx)
 
  static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
  {
+    if (unlikely(ctx->singlestep_enabled)) {
+        return false;
+    }
      return translator_use_goto_tb(&ctx->base, dest);
  }
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Richard Henderson
Quoted 8 lines · Richard Henderson

The change to use translator_use_goto_tb went too far, as the CF_SINGLE_STEP flag managed by the translator only handles gdb single stepping and not the architectural single stepping modeled in DisasContext.singlestep_enabled.

Fixes 6e9cc373ec5 ("target/ppc: Use translator_use_goto_tb")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1795

Thanks,

C.

Quoted 18 lines
---
  target/ppc/translate.c | 3 +++
  1 file changed, 3 insertions(+)
target/ppc/translate.c +3 -0
index e6a0709066..74796ec7ba 100644
@@ -4175,6 +4175,9 @@ static void pmu_count_insns(DisasContext *ctx)
 
  static inline bool use_goto_tb(DisasContext *ctx, target_ulong dest)
  {
+    if (unlikely(ctx->singlestep_enabled)) {
+        return false;
+    }
      return translator_use_goto_tb(&ctx->base, dest);
  }
 
Reviewed-by on v1 1/1
#3 lore raw
In reply to Richard Henderson
Quoted 11 lines · Richard Henderson

The change to use translator_use_goto_tb went too far, as the CF_SINGLE_STEP flag managed by the translator only handles gdb single stepping and not the architectural single stepping modeled in DisasContext.singlestep_enabled.

Fixes 6e9cc373ec5 ("target/ppc: Use translator_use_goto_tb")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1795

---
  target/ppc/translate.c | 3 +++
  1 file changed, 3 insertions(+)