qemu/include/hw/core
Peter Maydell 408b2b3d9d accel/tcg: Make TCGCPUOps::cpu_exec_halt return bool for whether to halt
The TCGCPUOps::cpu_exec_halt method is called from cpu_handle_halt()
when the CPU is halted, so that a target CPU emulation can do
anything target-specific it needs to do.  (At the moment we only use
this on i386.)

The current specification of the method doesn't allow the target
specific code to do something different if the CPU is about to come
out of the halt state, because cpu_handle_halt() only determines this
after the method has returned.  (If the method called cpu_has_work()
itself this would introduce a potential race if an interrupt arrived
between the target's method implementation checking and
cpu_handle_halt() repeating the check.)

Change the definition of the method so that it returns a bool to
tell cpu_handle_halt() whether to stay in halt or not.

We will want this for the Arm target, where FEAT_WFxT wants to do
some work only for the case where the CPU is in halt but about to
leave it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240430140035.3889879-2-peter.maydell@linaro.org
2024-05-30 16:13:48 +01:00
..
accel-cpu.h accel: Rename AccelCPUClass::cpu_realizefn() -> cpu_target_realize() 2023-10-03 08:00:25 -07:00
cpu.h Accelerator patches 2024-05-06 10:19:10 -07:00
generic-loader.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
resetcontainer.h hw/core: Add ResetContainer which holds objects implementing Resettable 2024-02-27 13:01:42 +00:00
split-irq.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
sysbus-fdt.h hw/core: Move the ARM sysbus-fdt to core 2022-04-29 10:48:26 +10:00
sysemu-cpu-ops.h memory: follow Error API guidelines 2023-10-19 23:13:27 +02:00
tcg-cpu-ops.h accel/tcg: Make TCGCPUOps::cpu_exec_halt return bool for whether to halt 2024-05-30 16:13:48 +01:00