[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/20] gdbstub: Check for TCG before calling tb_flush()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 03/20] gdbstub: Check for TCG before calling tb_flush() |
Date: |
Fri, 24 Jan 2025 00:43:57 +0100 |
Use the tcg_enabled() check so the compiler can elide
the call when TCG isn't available, allowing to remove
the tb_flush() stub.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/stubs/tcg-stub.c | 4 ----
gdbstub/system.c | 5 ++++-
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c
index 7f4208fddf2..b2b9881bdfb 100644
--- a/accel/stubs/tcg-stub.c
+++ b/accel/stubs/tcg-stub.c
@@ -14,10 +14,6 @@
#include "exec/tb-flush.h"
#include "exec/exec-all.h"
-void tb_flush(CPUState *cpu)
-{
-}
-
G_NORETURN void cpu_loop_exit(CPUState *cpu)
{
g_assert_not_reached();
diff --git a/gdbstub/system.c b/gdbstub/system.c
index 8ce79fa88cf..7f047a285c8 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -22,6 +22,7 @@
#include "system/cpus.h"
#include "system/runstate.h"
#include "system/replay.h"
+#include "system/tcg.h"
#include "hw/core/cpu.h"
#include "hw/cpu/cluster.h"
#include "hw/boards.h"
@@ -171,7 +172,9 @@ static void gdb_vm_state_change(void *opaque, bool running,
RunState state)
} else {
trace_gdbstub_hit_break();
}
- tb_flush(cpu);
+ if (tcg_enabled()) {
+ tb_flush(cpu);
+ }
ret = GDB_SIGNAL_TRAP;
break;
case RUN_STATE_PAUSED:
--
2.47.1
- [PATCH 00/20] accel: Simplify cpu-target.c (omnibus), Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 01/20] qemu/compiler: Absorb 'clang-tsa.h', Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 02/20] user: Extract common MMAP API to 'user/mmap.h', Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 03/20] gdbstub: Check for TCG before calling tb_flush(),
Philippe Mathieu-Daudé <=
- [PATCH 04/20] cpus: Cache CPUClass early in instance_init() handler, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 05/20] cpus: Keep default fields initialization in cpu_common_initfn(), Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 06/20] accel/kvm: Remove unused 'system/cpus.h' header in kvm-cpus.h, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 07/20] accel/tcg: Build tcg_flags helpers as common code, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 08/20] accel/tcg: Restrict tlb_init() / destroy() to TCG, Philippe Mathieu-Daudé, 2025/01/23