diff options
| author | Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> | 2026-08-19 14:33:45 +0200 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> | 2026-09-03 12:14:08 +0200 |
| commit | 5bcb5c4413aa397b7e10bef55a0273885d462bb3 (patch) | |
| tree | f47975b59483b006813feb22c67fafe0292687e5 /accel | |
| parent | 41ad827ba21d84e216c6ac41a73395b95c916396 (diff) | |
| download | qemu-5bcb5c4413aa397b7e10bef55a0273885d462bb3.tar.gz qemu-5bcb5c4413aa397b7e10bef55a0273885d462bb3.zip | |
accel/tcg: Restrict EXCP_HALTED handling to system emulation
EXCP_HALTED is defined and documented in "exec/cpu-common.h" as:
#define EXCP_HALTED 0x10003 /* cpu is halted (waiting for external event) */
Since vCPUs can not be halted in user-mode emulation, guard the
whole block within !CONFIG_USER_ONLY section. No logic changes.
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260819145649.23439-3-philmd@oss.qualcomm.com>
Diffstat (limited to 'accel')
| -rw-r--r-- | accel/tcg/cpu-exec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 53d90c400d..69207301d1 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -653,9 +653,9 @@ static inline void tb_add_jump(TranslationBlock *tb, int n, qemu_spin_unlock(&tb_next->jmp_lock); } +#ifndef CONFIG_USER_ONLY static inline bool cpu_handle_halt(CPUState *cpu) { -#ifndef CONFIG_USER_ONLY if (cpu->halted) { const TCGCPUOps *tcg_ops = cpu->cc->tcg_ops; bool leave_halt = tcg_ops->cpu_exec_halt(cpu); @@ -666,10 +666,10 @@ static inline bool cpu_handle_halt(CPUState *cpu) cpu->halted = 0; } -#endif /* !CONFIG_USER_ONLY */ return false; } +#endif /* !CONFIG_USER_ONLY */ static inline void cpu_handle_debug_exception(CPUState *cpu) { @@ -1027,9 +1027,11 @@ int cpu_exec(CPUState *cpu) /* replay_interrupt may need current_cpu */ current_cpu = cpu; +#ifndef CONFIG_USER_ONLY if (cpu_handle_halt(cpu)) { return EXCP_HALTED; } +#endif RCU_READ_LOCK_GUARD(); cpu_exec_enter(cpu); |
