From d5bd8d8267eba7379d94e0c2e46e54dd475d9886 Mon Sep 17 00:00:00 2001 From: Mads Ynddal Date: Wed, 2 Apr 2025 15:52:29 +0200 Subject: [PATCH] hvf: only update sysreg from owning thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit hv_vcpu_set_sys_reg should only be called from the owning thread of the vCPU, so to avoid crashes, the call to hvf_update_guest_debug is dispatched to the individual threads. Tested-by: Daniel Gomez Signed-off-by: Mads Ynddal Reviewed-by: Alex Bennée Message-id: 20250402135229.28143-3-mads@ynddal.dk Signed-off-by: Peter Maydell --- accel/hvf/hvf-all.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index d404e01ade..3fc65d6b23 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -58,8 +58,13 @@ int hvf_sw_breakpoints_active(CPUState *cpu) return !QTAILQ_EMPTY(&hvf_state->hvf_sw_breakpoints); } -int hvf_update_guest_debug(CPUState *cpu) +static void do_hvf_update_guest_debug(CPUState *cpu, run_on_cpu_data arg) { hvf_arch_update_guest_debug(cpu); +} + +int hvf_update_guest_debug(CPUState *cpu) +{ + run_on_cpu(cpu, do_hvf_update_guest_debug, RUN_ON_CPU_NULL); return 0; } -- 2.39.5