qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-10.2] target/arm/hvf: Break loop if guest halted vCPU during hv_vcpu_run()
@ 2025-12-02 17:51 Philippe Mathieu-Daudé
  2025-12-03 12:35 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-02 17:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Mads Ynddal, Richard Henderson, Alexander Graf, Peter Maydell,
	Christian Stussak, qemu-arm, Philippe Mathieu-Daudé

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é <philmd@linaro.org>
---
 target/arm/hvf/hvf.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index de1e8fb8a05..10ac5559ca1 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -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);
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH-for-10.2] target/arm/hvf: Break loop if guest halted vCPU during hv_vcpu_run()
  2025-12-02 17:51 [PATCH-for-10.2] target/arm/hvf: Break loop if guest halted vCPU during hv_vcpu_run() Philippe Mathieu-Daudé
@ 2025-12-03 12:35 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-03 12:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: Mads Ynddal, Richard Henderson, Alexander Graf, Peter Maydell,
	Christian Stussak, qemu-arm

On 2/12/25 18:51, Philippe Mathieu-Daudé wrote:
> 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é <philmd@linaro.org>
> ---
>   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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-03 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02 17:51 [PATCH-for-10.2] target/arm/hvf: Break loop if guest halted vCPU during hv_vcpu_run() Philippe Mathieu-Daudé
2025-12-03 12:35 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).