From: "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
To: qemu-devel@nongnu.org
Cc: "Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-ppc@nongnu.org, qemu-s390x@nongnu.org,
"Richard Henderson" <richard.henderson@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
qemu-riscv@nongnu.org, qemu-arm@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers
Date: Wed, 2 Sep 2026 17:20:31 +0200 [thread overview]
Message-ID: <20260902152044.31291-1-philmd@oss.qualcomm.com> (raw)
This is a respin of Robert Foley's v2 series from August 2020 [1]
triggered by a broader review of BQL contract in my halt-to-exec
transitions series by Peter [2] and Mark [3].
v3:
- kind of rebase
- rename misleading fake_user_interrupt callback names for clarity
- restrict interrupt handlers to their appropriate modes (system vs user)
- explicitly document that do_interrupt() and cpu_exec_interrupt()
callbacks are called WITH BQL held (explicit BQL contract in docstrings)
v2 Summary
----------
This series pushes the Big QEMU Lock (BQL) down from the core TCG
cpu_handle_interrupt/cpu_handle_exception paths into per-target
implementations. This allows each architecture to manage BQL locking
granularity independently, reducing contention on a known bottleneck
as measured by QEMU sync profiling (qsp).
The BQL has long been a scaling bottleneck in QEMU, and the
interrupt/exception handling path is one of its heaviest users. By
allowing targets to acquire the BQL only when needed, we enable
future per-target optimizations.
Refs:
[1] https://lore.kernel.org/qemu-devel/20200819182856.4893-1-robert.foley@linaro.org/
[2] https://lore.kernel.org/qemu-devel/CAFEAcA8xk8y1W0UvttpVhKYuoMBSQqZoF_15of0Rrq4wKkWDuw@mail.gmail.com/
[3] https://lore.kernel.org/qemu-devel/69d07179-388e-4285-902b-36788b2b3da1@nutanix.com/
Philippe Mathieu-Daudé (10):
target/arm: Call arm*_cpu_do_interrupt directly instead of via
TCGCPUOps
target/s390x: Restrict interrupt handlers to system mode
target/i386: Rename fake_do_interrupt to fake_user_exception
accel/tcg: Document cpu_exec_interrupt() callback contract
accel/tcg: Document do_interrupt() callback contract
accel/tcg: Add do_interrupt() wrapper for targets to manage BQL
target/hexagon: Move to do_interrupt() (BQL acquired internally)
targets: Move interrupt handlers to do_interrupt()
targets: Move BQL locking into do_interrupt() handlers
accel/tcg: Remove do_interrupt_locked() callback
Robert Foley (1):
accel/tcg: Rename do_interrupt() to do_interrupt_locked()
include/accel/tcg/cpu-ops.h | 32 +++++++++++++++++++++++++----
target/arm/internals.h | 2 +-
target/i386/tcg/helper-tcg.h | 4 +++-
target/s390x/s390x-internal.h | 5 ++---
accel/tcg/cpu-exec.c | 7 +++----
target/alpha/helper.c | 3 +++
target/arm/cpu-irq.c | 2 +-
target/arm/helper.c | 1 +
target/arm/tcg/cpu-v7m.c | 2 +-
target/arm/tcg/m_helper.c | 2 ++
target/avr/helper.c | 3 +++
target/hppa/int_helper.c | 2 ++
target/i386/tcg/system/seg_helper.c | 2 ++
target/i386/tcg/tcg-cpu.c | 2 +-
target/i386/tcg/user/seg_helper.c | 6 +++---
target/mips/tcg/system/tlb_helper.c | 3 +++
target/ppc/excp_helper.c | 2 ++
target/rx/helper.c | 3 +++
target/s390x/tcg/excp_helper.c | 8 +++-----
target/sh4/helper.c | 3 +++
target/sparc/int32_helper.c | 2 ++
target/sparc/int64_helper.c | 2 ++
target/xtensa/exc_helper.c | 2 ++
23 files changed, 76 insertions(+), 24 deletions(-)
--
2.53.0
next reply other threads:[~2026-09-02 15:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 15:20 Philippe Mathieu-Daudé [this message]
2026-09-02 15:20 ` [PATCH v3 03/11] target/i386: Rename fake_do_interrupt to fake_user_exception Philippe Mathieu-Daudé
2026-09-13 2:44 ` Richard Henderson
2026-09-02 15:20 ` [PATCH v3 04/11] accel/tcg: Document cpu_exec_interrupt() callback contract Philippe Mathieu-Daudé
2026-09-08 16:25 ` Peter Maydell
2026-09-02 15:20 ` [PATCH v3 08/11] target/hexagon: Move to do_interrupt() (BQL acquired internally) Philippe Mathieu-Daudé
2026-09-03 0:15 ` Brian Cain
2026-09-13 3:55 ` Richard Henderson
2026-09-02 15:20 ` [RFC PATCH v3 09/11] targets: Move interrupt handlers to do_interrupt() Philippe Mathieu-Daudé
2026-09-02 15:20 ` [RFC PATCH v3 10/11] targets: Move BQL locking into do_interrupt() handlers Philippe Mathieu-Daudé
2026-09-02 15:33 ` [PATCH v3 00/11] accel/tcg: Push BQL down into per-target do_interrupt handlers Philippe Mathieu-Daudé
[not found] ` <20260902152044.31291-6-philmd@oss.qualcomm.com>
2026-09-02 19:54 ` [PATCH v3 05/11] accel/tcg: Document do_interrupt() callback contract Pierrick Bouvier
2026-09-02 20:48 ` Philippe Mathieu-Daudé
2026-09-13 3:30 ` Richard Henderson
[not found] ` <20260902152044.31291-2-philmd@oss.qualcomm.com>
2026-09-02 19:52 ` [PATCH v3 01/11] target/arm: Call arm*_cpu_do_interrupt directly instead of via TCGCPUOps Pierrick Bouvier
2026-09-08 16:09 ` Peter Maydell
2026-09-13 2:42 ` Richard Henderson
[not found] ` <20260902152044.31291-3-philmd@oss.qualcomm.com>
2026-09-02 19:52 ` [PATCH v3 02/11] target/s390x: Restrict interrupt handlers to system mode Pierrick Bouvier
2026-09-13 2:43 ` Richard Henderson
[not found] ` <20260902152044.31291-8-philmd@oss.qualcomm.com>
2026-09-13 3:50 ` [PATCH v3 07/11] accel/tcg: Add do_interrupt() wrapper for targets to manage BQL Richard Henderson
[not found] ` <20260902152044.31291-12-philmd@oss.qualcomm.com>
2026-09-13 4:00 ` [PATCH v3 11/11] accel/tcg: Remove do_interrupt_locked() callback Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260902152044.31291-1-philmd@oss.qualcomm.com \
--to=philmd@oss.qualcomm.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox