[PATCH v2 01/12] gdbstub: Remove tb_flush uses

Richard Henderson posted 12 patches 5 days, 13 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Nicholas Piggin <npiggin@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Laurent Vivier <laurent@vivier.eu>, Alexandre Iooss <erdnaxe@crans.org>, Mahmoud Mandour <ma.mandourr@gmail.com>, Pierrick Bouvier <pierrick.bouvier@linaro.org>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
There is a newer version of this series
[PATCH v2 01/12] gdbstub: Remove tb_flush uses
Posted by Richard Henderson 5 days, 13 hours ago
This hasn't been needed since d828b92b8a6
("accel/tcg: Introduce CF_BP_PAGE").

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
Cc: Alex Bennée <alex.bennee@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 gdbstub/system.c | 4 ----
 gdbstub/user.c   | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/gdbstub/system.c b/gdbstub/system.c
index 5be0d3c58c..df3514dc74 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -18,7 +18,6 @@
 #include "gdbstub/syscalls.h"
 #include "gdbstub/commands.h"
 #include "exec/hwaddr.h"
-#include "exec/tb-flush.h"
 #include "accel/accel-ops.h"
 #include "accel/accel-cpu-ops.h"
 #include "system/cpus.h"
@@ -174,9 +173,6 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state)
         } else {
             trace_gdbstub_hit_break();
         }
-        if (tcg_enabled()) {
-            tb_flush(cpu);
-        }
         ret = GDB_SIGNAL_TRAP;
         break;
     case RUN_STATE_PAUSED:
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 67403e5a25..2e14ded3f0 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -15,7 +15,6 @@
 #include "qemu/sockets.h"
 #include "qapi/error.h"
 #include "exec/hwaddr.h"
-#include "exec/tb-flush.h"
 #include "exec/gdbstub.h"
 #include "gdbstub/commands.h"
 #include "gdbstub/syscalls.h"
@@ -220,7 +219,6 @@ int gdb_handlesig(CPUState *cpu, int sig, const char *reason, void *siginfo,
 
     /* disable single step if it was enabled */
     cpu_single_step(cpu, 0);
-    tb_flush(cpu);
 
     if (sig != 0) {
         gdb_set_stop_cpu(cpu);
@@ -539,7 +537,6 @@ static void disable_gdbstub(CPUState *thread_cpu)
         /* no cpu_watchpoint_remove_all for user-mode */
         cpu_single_step(cpu, 0);
     }
-    tb_flush(thread_cpu);
 }
 
 void gdbserver_fork_end(CPUState *cpu, pid_t pid)
-- 
2.43.0


Re: [PATCH v2 01/12] gdbstub: Remove tb_flush uses
Posted by Philippe Mathieu-Daudé 5 days, 6 hours ago
On 23/9/25 04:39, Richard Henderson wrote:
> This hasn't been needed since d828b92b8a6
> ("accel/tcg: Introduce CF_BP_PAGE").
> 
> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> Cc: Alex Bennée <alex.bennee@linaro.org>
> Cc: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   gdbstub/system.c | 4 ----
>   gdbstub/user.c   | 3 ---
>   2 files changed, 7 deletions(-)
> 
> diff --git a/gdbstub/system.c b/gdbstub/system.c
> index 5be0d3c58c..df3514dc74 100644
> --- a/gdbstub/system.c
> +++ b/gdbstub/system.c
> @@ -18,7 +18,6 @@
>   #include "gdbstub/syscalls.h"
>   #include "gdbstub/commands.h"
>   #include "exec/hwaddr.h"
> -#include "exec/tb-flush.h"
>   #include "accel/accel-ops.h"
>   #include "accel/accel-cpu-ops.h"
>   #include "system/cpus.h"
> @@ -174,9 +173,6 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState state)
>           } else {
>               trace_gdbstub_hit_break();
>           }
> -        if (tcg_enabled()) {
> -            tb_flush(cpu);
> -        }
>           ret = GDB_SIGNAL_TRAP;
>           break;
>       case RUN_STATE_PAUSED:

To squash:

-- >8 --
diff --git a/gdbstub/system.c b/gdbstub/system.c
index f31d401e0b3..c139476bf26 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -26,3 +26,2 @@
  #include "system/replay.h"
-#include "system/tcg.h"
  #include "hw/core/cpu.h"
---

Re: [PATCH v2 01/12] gdbstub: Remove tb_flush uses
Posted by Richard Henderson 4 days, 23 hours ago
On 9/23/25 02:11, Philippe Mathieu-Daudé wrote:
>> @@ -174,9 +173,6 @@ static void gdb_vm_state_change(void *opaque, bool running, RunState 
>> state)
>>           } else {
>>               trace_gdbstub_hit_break();
>>           }
>> -        if (tcg_enabled()) {
>> -            tb_flush(cpu);
>> -        }
>>           ret = GDB_SIGNAL_TRAP;
>>           break;
>>       case RUN_STATE_PAUSED:
> 
> To squash:
> 
> -- >8 --
> diff --git a/gdbstub/system.c b/gdbstub/system.c
> index f31d401e0b3..c139476bf26 100644
> --- a/gdbstub/system.c
> +++ b/gdbstub/system.c
> @@ -26,3 +26,2 @@
>   #include "system/replay.h"
> -#include "system/tcg.h"
>   #include "hw/core/cpu.h"
> ---

Done, thanks.

r~