From: Philippe Mathieu-Daudé Date: Tue, 28 Oct 2025 05:41:44 +0000 (+0100) Subject: accel/hvf: Mention hvf_arch_init_vcpu() must run on vCPU thread X-Git-Tag: v10.2.0-rc1~28^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a641384325506d035490ce79d3c3319a829c47d0;p=thirdparty%2Fqemu.git accel/hvf: Mention hvf_arch_init_vcpu() must run on vCPU thread hvf_arch_init_vcpu(), along with hvf_put_guest_debug_registers() and hvf_put_gdbstub_debug_registers(), calls hv_vcpu_set_sys_reg(), which must run on a vCPU. Mention they also must. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Mads Ynddal Signed-off-by: Peter Maydell --- diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index 8fce627b08..0c335facc3 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -71,11 +71,12 @@ void assert_hvf_ok_impl(hv_return_t ret, const char *file, unsigned int line, const char *hvf_return_string(hv_return_t ret); int hvf_arch_init(void); hv_return_t hvf_arch_vm_create(MachineState *ms, uint32_t pa_range); -int hvf_arch_init_vcpu(CPUState *cpu); void hvf_arch_vcpu_destroy(CPUState *cpu); hvf_slot *hvf_find_overlap_slot(uint64_t, uint64_t); void hvf_kick_vcpu_thread(CPUState *cpu); +/* Must be called by the owning thread */ +int hvf_arch_init_vcpu(CPUState *cpu); /* Must be called by the owning thread */ int hvf_arch_vcpu_exec(CPUState *); /* Must be called by the owning thread */ diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index fdf8df09d4..8095cb0805 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2119,6 +2119,7 @@ void hvf_arch_remove_all_hw_breakpoints(void) * Update the vCPU with the gdbstub's view of debug registers. This view * consists of all hardware breakpoints and watchpoints inserted so far while * debugging the guest. + * Must be called by the owning thread. */ static void hvf_put_gdbstub_debug_registers(CPUState *cpu) { @@ -2157,6 +2158,7 @@ static void hvf_put_gdbstub_debug_registers(CPUState *cpu) /* * Update the vCPU with the guest's view of debug registers. This view is kept * in the environment at all times. + * Must be called by the owning thread. */ static void hvf_put_guest_debug_registers(CPUState *cpu) {