qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] accel/tcg: Improve tb_flush usage
@ 2025-09-23  2:39 Richard Henderson
  2025-09-23  2:39 ` [PATCH v2 01/12] gdbstub: Remove tb_flush uses Richard Henderson
                   ` (11 more replies)
  0 siblings, 12 replies; 36+ messages in thread
From: Richard Henderson @ 2025-09-23  2:39 UTC (permalink / raw)
  To: qemu-devel

It is too easy to mis-use tb_flush().  For instance, because of
the cpu argument, some parts assumed that it needed to call the
global flush function for every cpu.  It is easy to forget that
the flush is not complete when the call returns: we have merely
queued work to the cpu run loop.  So: remove tb_flush and expose
only the core as tb_flush__exclusive, to be used only when we
are already within an exclusive context.

In some cases (gdbstub, alpha, riscv, ppc spapr),
we can eliminate the need for tb_flush completely.

Changes for v2:
  - Assert exclusivity in tb_flush__exclusive (pbo)


r~


Richard Henderson (12):
  gdbstub: Remove tb_flush uses
  accel/tcg: Split out tb_flush__exclusive
  target/alpha: Simplify call_pal implementation
  target/riscv: Record misa_ext in TCGTBCPUState.cs_base
  accel/tcg: Move post-load tb_flush to vm_change_state hook
  hw/ppc/spapr: Use tb_invalidate_phys_range in h_page_init
  linux-user: Use tb_flush_exclusive to start second thread
  plugins: Use tb_flush__exclusive
  accel/tcg: Introduce EXCP_TB_FLUSH
  accel/tcg: Use EXCP_TB_FLUSH in tb_gen_code
  accel/tcg: Remove tb_flush
  accel/tcg: Tighten assert in tb_flush__exclusive

 include/exec/cpu-common.h       |  1 +
 include/exec/tb-flush.h         | 18 ++++++--------
 target/alpha/helper.h           |  1 -
 accel/tcg/tb-maint.c            | 43 +++++++++++----------------------
 accel/tcg/tcg-accel-ops-mttcg.c |  7 ++++++
 accel/tcg/tcg-accel-ops-rr.c    |  9 +++++--
 accel/tcg/tcg-all.c             | 21 ++++++++++++++++
 accel/tcg/translate-all.c       |  5 +---
 gdbstub/system.c                |  4 ---
 gdbstub/user.c                  |  3 ---
 hw/core/cpu-system.c            |  8 ------
 hw/ppc/spapr_hcall.c            |  4 +--
 linux-user/mmap.c               |  4 +--
 linux-user/syscall.c            |  2 +-
 plugins/core.c                  |  6 ++---
 plugins/loader.c                |  2 +-
 target/alpha/sys_helper.c       |  6 -----
 target/alpha/translate.c        | 21 +++++-----------
 target/riscv/csr.c              |  3 ---
 target/riscv/tcg/tcg-cpu.c      |  3 ++-
 20 files changed, 75 insertions(+), 96 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2025-09-28 23:13 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23  2:39 [PATCH v2 00/12] accel/tcg: Improve tb_flush usage Richard Henderson
2025-09-23  2:39 ` [PATCH v2 01/12] gdbstub: Remove tb_flush uses Richard Henderson
2025-09-23  9:11   ` Philippe Mathieu-Daudé
2025-09-23 16:23     ` Richard Henderson
2025-09-23  2:39 ` [PATCH v2 02/12] accel/tcg: Split out tb_flush__exclusive Richard Henderson
2025-09-23  7:17   ` Philippe Mathieu-Daudé
2025-09-23  9:16   ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 03/12] target/alpha: Simplify call_pal implementation Richard Henderson
2025-09-23  7:30   ` Philippe Mathieu-Daudé
2025-09-23  9:05     ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 04/12] target/riscv: Record misa_ext in TCGTBCPUState.cs_base Richard Henderson
2025-09-24  6:17   ` LIU Zhiwei
2025-09-24 12:23   ` Daniel Henrique Barboza
2025-09-28 23:10   ` Alistair Francis
2025-09-23  2:39 ` [PATCH v2 05/12] accel/tcg: Move post-load tb_flush to vm_change_state hook Richard Henderson
2025-09-23  7:22   ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 06/12] hw/ppc/spapr: Use tb_invalidate_phys_range in h_page_init Richard Henderson
2025-09-23  4:49   ` Harsh Prateek Bora
2025-09-23  8:55   ` Philippe Mathieu-Daudé
2025-09-23  9:45     ` Harsh Prateek Bora
2025-09-23 16:59     ` Richard Henderson
2025-09-23  2:39 ` [PATCH v2 07/12] linux-user: Use tb_flush_exclusive to start second thread Richard Henderson
2025-09-23  8:50   ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 08/12] plugins: Use tb_flush__exclusive Richard Henderson
2025-09-23  7:33   ` Philippe Mathieu-Daudé
2025-09-23 13:35   ` Philippe Mathieu-Daudé
2025-09-23 20:28     ` Richard Henderson
2025-09-24  3:18       ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 09/12] accel/tcg: Introduce EXCP_TB_FLUSH Richard Henderson
2025-09-23  7:10   ` Paolo Bonzini
2025-09-23 20:02     ` Richard Henderson
2025-09-23  2:39 ` [PATCH v2 10/12] accel/tcg: Use EXCP_TB_FLUSH in tb_gen_code Richard Henderson
2025-09-23  9:15   ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 11/12] accel/tcg: Remove tb_flush Richard Henderson
2025-09-23  7:24   ` Philippe Mathieu-Daudé
2025-09-23  2:39 ` [PATCH v2 12/12] accel/tcg: Tighten assert in tb_flush__exclusive Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).