qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/10] accel/tcg: Improve tb_flush usage
@ 2025-09-23 21:54 Richard Henderson
  2025-09-23 21:54 ` [PATCH v3 01/10] gdbstub: Remove tb_flush uses Richard Henderson
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Richard Henderson @ 2025-09-23 21:54 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 v3:
  - Rename to tb_flush__exclusive_or_serial; retain the serial
    check within, not updating to exclusive only.
  - Rename the existing tb_flush to queue_tb_flush; retain the
    sequence number check for duplicated flushes.
  - Drop EXCP_TB_FLUSH.
  - Improve buffer overflow flush when we're already serial.
  - Other minor comment/review updates.


r~


Richard Henderson (10):
  gdbstub: Remove tb_flush uses
  target/alpha: Simplify call_pal implementation
  target/riscv: Record misa_ext in TCGTBCPUState.cs_base
  hw/ppc/spapr: Use tb_invalidate_phys_range in h_page_init
  accel/tcg: Split out tb_flush__exclusive_or_serial
  accel/tcg: Move post-load tb_flush to vm_change_state hook
  plugins: Use tb_flush__exclusive_or_serial
  linux-user: Split out begin_parallel_context
  accel/tcg: Create queue_tb_flush from tb_flush
  accel/tcg: Improve buffer overflow in tb_gen_code

 include/exec/tb-flush.h     | 30 ++++++++++++++--------
 linux-user/user-internals.h | 16 ++++++++++++
 target/alpha/helper.h       |  1 -
 accel/tcg/plugin-gen.c      |  4 +--
 accel/tcg/tb-maint.c        | 50 +++++++++++++++++++++----------------
 accel/tcg/tcg-all.c         | 21 ++++++++++++++++
 accel/tcg/translate-all.c   |  6 ++++-
 gdbstub/system.c            |  5 ----
 gdbstub/user.c              |  3 ---
 hw/core/cpu-system.c        |  9 -------
 hw/ppc/spapr_hcall.c        |  4 +--
 linux-user/alpha/cpu_loop.c |  5 ----
 linux-user/mmap.c           | 13 ++--------
 linux-user/syscall.c        |  7 +-----
 plugins/core.c              |  6 ++---
 plugins/loader.c            |  3 +--
 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, 108 insertions(+), 108 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2025-09-25  2:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 21:54 [PATCH v3 00/10] accel/tcg: Improve tb_flush usage Richard Henderson
2025-09-23 21:54 ` [PATCH v3 01/10] gdbstub: Remove tb_flush uses Richard Henderson
2025-09-23 21:54 ` [PATCH v3 02/10] target/alpha: Simplify call_pal implementation Richard Henderson
2025-09-23 21:54 ` [PATCH v3 03/10] target/riscv: Record misa_ext in TCGTBCPUState.cs_base Richard Henderson
2025-09-23 21:54 ` [PATCH v3 04/10] hw/ppc/spapr: Use tb_invalidate_phys_range in h_page_init Richard Henderson
2025-09-24  3:20   ` Philippe Mathieu-Daudé
2025-09-23 21:54 ` [PATCH v3 05/10] accel/tcg: Split out tb_flush__exclusive_or_serial Richard Henderson
2025-09-25  2:15   ` Philippe Mathieu-Daudé
2025-09-23 21:54 ` [PATCH v3 06/10] accel/tcg: Move post-load tb_flush to vm_change_state hook Richard Henderson
2025-09-23 21:54 ` [PATCH v3 07/10] plugins: Use tb_flush__exclusive_or_serial Richard Henderson
2025-09-23 21:54 ` [PATCH v3 08/10] linux-user: Split out begin_parallel_context Richard Henderson
2025-09-24  3:23   ` Philippe Mathieu-Daudé
2025-09-23 21:54 ` [PATCH v3 09/10] accel/tcg: Create queue_tb_flush from tb_flush Richard Henderson
2025-09-24  3:26   ` Philippe Mathieu-Daudé
2025-09-23 21:54 ` [PATCH v3 10/10] accel/tcg: Improve buffer overflow in tb_gen_code Richard Henderson
2025-09-24 12:14 ` [PATCH v3 00/10] accel/tcg: Improve tb_flush usage Philippe Mathieu-Daudé
2025-09-24 16:39   ` 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).