]> git.ipfire.org Git - thirdparty/qemu.git/commit
accel: use atomic accesses for exit_request
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Aug 2025 16:55:48 +0000 (18:55 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Sep 2025 17:00:55 +0000 (19:00 +0200)
commitf084ff128b6136e1aebfd73e1cf7066a077a79bf
treed79f494cbc5bc28369bedfee0cdc5fed2d765a94
parentac6c8a390b451913995ee784ef7261b8928e5ace
accel: use atomic accesses for exit_request

CPU threads write exit_request as a "note to self" that they need to
go out to a slow path.  This write happens out of the BQL and can be
a data race with another threads' cpu_exit(); use atomic accesses
consistently.

While at it, change the source argument from int ("1") to bool ("true").

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c
accel/tcg/tcg-accel-ops-mttcg.c
accel/tcg/tcg-accel-ops-rr.c
hw/ppc/spapr_hcall.c
include/hw/core/cpu.h
target/i386/kvm/kvm.c
target/i386/nvmm/nvmm-accel-ops.c
target/i386/nvmm/nvmm-all.c
target/i386/whpx/whpx-all.c