target/arm/hvf: Break loop if guest halted vCPU during hv_vcpu_run()
Since commit 93ac765076a we try to call hv_vcpu_run() many times in a row, but we missed the guest could have halted a vCPU; if so we need to return to outer loop.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3228
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3230
Fixes 93ac765076a ("target/arm/hvf: Keep calling hv_vcpu_run() in loop")
Signed-off-by Philippe Mathieu-Daudé <[email protected]>
--- target/arm/hvf/hvf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
target/arm/hvf/hvf.c +4 -4
@@ -2029,10 +2029,6 @@ int hvf_arch_vcpu_exec(CPUState *cpu)int ret;hv_return_t r; -if (cpu->halted) { -return EXCP_HLT ; - } -flush_cpu_state (cpu); do {
@@ -2041,6 +2037,10 @@ int hvf_arch_vcpu_exec(CPUState *cpu)return EXCP_INTERRUPT ; } +if (cpu->halted) { +return EXCP_HLT ; + } +bql_unlock ();cpu_exec_start (cpu); r =hv_vcpu_run (cpu->accel->fd);
Signature · 1 line
2.51.0
Quoted 11 lines · Philippe Mathieu-Daudé
Since commit
93ac765076awe try to callhv_vcpu_run()many times in a row, but we missed the guest could have halted a vCPU; if so we need to return to outer loop.Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3228
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3230Fixes 93ac765076a ("target/arm/hvf: Keep calling hv_vcpu_run() in loop")Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/hvf/hvf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Per https://gitlab.com/qemu-project/qemu/-/issues/3228#note_2928617511,
this doesn't work; so self-NAck.