accel, cpus: clean up cpu->exit_request
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest19 patches 6 repliesIn review
- v218 patches 39 repliesSuperseded
- v18 patches 22 repliesSuperseded
Changes in v3 from the cover letter
- [accel: use store_release/load_acquire for cross-thread exit_request] improve comments for memory barriers, match rr_kick_next_cpu() more accurately
- [cpus: properly kick CPUs out of inner execution loop] fix comment
- [treewide: rename qemu_wait_io_event/qemu_wait_io_event_common] new patch; new names used throughout in patches 16-19
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/19 | target/ppc: limit cpu_interrupt_exittb to system emulationtarget/ | +2 | 0 replies | |
| 2/19 | target/sparc: limit cpu_check_irqs to system emulationtarget/ target/ | +4 | 0 replies | |
| 3/19 | target/i386: limit a20 to system emulationtarget/ | +2 | 0 replies | |
| 4/19 | target-arm: remove uses of cpu_interrupt() for user-mode emulationtarget/ target/ target/ +3 more | +429 | 0 replies | |
| 5/19 | user-exec: remove cpu_interrupt() stubaccel/ | +0 | 0 replies | |
| 6/19 | treewide: clear bits of cs->interrupt_request with cpu_reset_interrupt()accel/ hw/ target/ +9 more | +39 | 0 replies | |
| 7/19 | cpu-common: use atomic access for interrupt_requesthw/ include/ system/ | +2 | 0 replies | |
| 8/19 | cpus: document that qemu_cpu_kick() can be used for BQL-less operationinclude/ | +2 | 0 replies | |
| 9/19 | accel: use store_release/load_acquire for cross-thread exit_requestaccel/ accel/ accel/ +3 more | +29 | 0 replies | |
| 10/19 | accel: use atomic accesses for exit_requestaccel/ accel/ accel/ +6 more | +24 | 0 replies | |
| 11/19 | accel/tcg: create a thread-kick function for TCGaccel/ accel/ accel/ +7 more | +16 | 0 replies | |
| 12/19 | accel/tcg: inline cpu_exit()accel/ | +12 | 0 replies | |
| 13/19 | cpus: remove TCG-ism from cpu_exit()hw/ | +1 | 0 replies | |
| 14/19 | cpus: properly kick CPUs out of inner execution loopcpu-common.c hw/ hw/ +6 more | +17 | 1 reply | |
| 15/19 | treewide: rename qemu_wait_io_event/qemu_wait_io_event_commonaccel/ accel/ accel/ +8 more | +15 | 1 reply | |
| 16/19 | bsd-user, linux-user: introduce qemu_process_cpu_eventsaccel/ bsd-user/ bsd-user/ +22 more | +36 | 0 replies | |
| 17/19 | cpus: clear exit_request in qemu_process_cpu_eventsaccel/ accel/ accel/ +5 more | +9 | 0 replies | |
| 18/19 | accel: make all calls to qemu_process_cpu_events look the sameaccel/ accel/ accel/ +4 more | +30 | 0 replies | |
| 19/19 | tcg/user: do not set exit_request gratuitouslyaccel/ | +2 | 4 replies |
Reviews trailers per patch
All 19 patches have a Reviewed-by or Acked-by.
| Patch | Igor Mammedov | Richard Henderson | Philippe Mathieu-Daudé | Peter Xu |
|---|---|---|---|---|
| 1/19 | R-b | R-b | ||
| 2/19 | R-b | R-b | ||
| 3/19 | R-b | R-b | R-b | |
| 4/19 | R-b | |||
| 5/19 | R-b | R-b | ||
| 6/19 | R-b | R-b | R-b | |
| 7/19 | R-b | R-b | R-b | |
| 8/19 | R-b | |||
| 9/19 | R-b | R-b | R-b | |
| 10/19 | R-b | R-b | R-b | R-b |
| 11/19 | R-b | R-b | R-b | |
| 12/19 | R-b | R-b | ||
| 13/19 | R-b | R-b | R-b | |
| 14/19 | R-b | |||
| 15/19 | R-b | |||
| 16/19 | R-b | R-b | ||
| 17/19 | R-b | R-b | ||
| 18/19 | R-b | R-b | ||
| 19/19 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v3 00/19] accel, cpus: clean up cpu->exit_request
cpu->exit_request is used to kick vCPU threads into qemu_wait_io_event(). The code that handles the signaling of cpu->exit_request is messy, mostly due to no one ever taking a look at it as a whole. In fact already in commit 4b8523ee896 ("kvm: First step to push iothread lock out of inner run loop", 2015-07-01), the read of cpu->exit_request was placed outside the BQL critical section without much attention to ordering; and it only got worse from that point, in no small part due to a young and naive me.
This series is complementary to the cpu->interrupt_request cleanups that Igor did in "memory: reintroduce BQL-free fine-grained PIO/MMIO"
(https://lore.kernel.org/qemu-devel/[email protected]/T/),
and in fact includes some extra changes to interrupt_request at the beginning.
Paolo
Paolo Bonzini (19):
target/ppc: limit cpu_interrupt_exittb to system emulation target/sparc: limit cpu_check_irqs to system emulation target/i386: limit a20 to system emulation
target-arm: remove uses of cpu_interrupt() for user-mode emulation
user-exec: remove cpu_interrupt() stub
treewide: clear bits of cs->interrupt_request with cpu_reset_interrupt()
cpu-common: use atomic access for interrupt_request
cpus: document that qemu_cpu_kick() can be used for BQL-less operation
accel: use store_release/load_acquire for cross-thread exit_request
accel: use atomic accesses for exit_request
accel/tcg: create a thread-kick function for TCG
accel/tcg: inline cpu_exit()
cpus: remove TCG-ism from cpu_exit()
cpus: properly kick CPUs out of inner execution loop
treewide: rename qemu_wait_io_event/qemu_wait_io_event_common bsd-user, linux-user: introduce qemu_process_cpu_events
cpus: clear exit_request in qemu_process_cpu_events
accel: make all calls to qemu_process_cpu_events look the same tcg/user: do not set exit_request gratuitously
v2->v3:
- [accel: use store_release/load_acquire for cross-thread exit_request] improve comments for memory barriers, match rr_kick_next_cpu() more accurately
- [cpus: properly kick CPUs out of inner execution loop] fix comment
- [treewide: rename qemu_wait_io_event/qemu_wait_io_event_common] new patch; new names used throughout in patches 16-19
docs/devel/tcg-icount.rst | 2 +- accel/tcg/tcg-accel-ops-mttcg.h | 3 - accel/tcg/tcg-accel-ops.h | 1 + bsd-user/aarch64/target_arch_cpu.h | 2 +- bsd-user/arm/target_arch_cpu.h | 2 +- bsd-user/i386/target_arch_cpu.h | 2 +- bsd-user/riscv/target_arch_cpu.h | 2 +- bsd-user/x86_64/target_arch_cpu.h | 2 +- include/hw/core/cpu.h | 22 +- include/system/cpus.h | 3 +- target/arm/internals.h | 5 + accel/dummy-cpus.c | 2 +- accel/hvf/hvf-accel-ops.c | 2 +- accel/kvm/kvm-accel-ops.c | 3 +- accel/kvm/kvm-all.c | 23 +- accel/tcg/cpu-exec.c | 34 ++- accel/tcg/tcg-accel-ops-mttcg.c | 12 +- accel/tcg/tcg-accel-ops-rr.c | 55 ++-- accel/tcg/tcg-accel-ops.c | 4 +- accel/tcg/user-exec.c | 11 +- bsd-user/main.c | 5 - cpu-common.c | 3 +- hw/core/cpu-common.c | 19 +- hw/core/cpu-system.c | 2 +- hw/ppc/ppc.c | 2 + hw/ppc/spapr_hcall.c | 7 +- hw/ppc/spapr_rtas.c | 2 +- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/main.c | 5 - linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- replay/replay-events.c | 3 +- system/cpu-timers.c | 6 +- system/cpus.c | 15 +- target/arm/cpu-irq.c | 381 ++++++++++++++++++++++++++++ target/arm/cpu.c | 370 --------------------------- target/arm/el2-stubs.c | 37 +++ target/arm/helper.c | 4 + target/arm/tcg/mte_helper.c | 2 +- target/avr/helper.c | 4 +- target/i386/helper.c | 2 + target/i386/hvf/x86hvf.c | 8 +- target/i386/kvm/hyperv.c | 1 - target/i386/kvm/kvm.c | 20 +- target/i386/nvmm/nvmm-accel-ops.c | 8 +- target/i386/nvmm/nvmm-all.c | 19 +- target/i386/tcg/system/seg_helper.c | 13 +- target/i386/tcg/system/svm_helper.c | 2 +- target/i386/whpx/whpx-accel-ops.c | 6 +- target/i386/whpx/whpx-all.c | 23 +- target/openrisc/sys_helper.c | 2 +- target/ppc/helper_regs.c | 2 + target/rx/helper.c | 4 +- target/s390x/tcg/excp_helper.c | 2 +- target/sparc/int32_helper.c | 2 + target/sparc/int64_helper.c | 2 + target/arm/meson.build | 2 + 71 files changed, 645 insertions(+), 566 deletions(-) create mode 100644 target/arm/cpu-irq.c create mode 100644 target/arm/el2-stubs.c
Signature · 1 line
2.51.0