From: Magnus Kulke <magnuskulke@linux.microsoft.com>
To: "Doru Blânzeanu" <dblanzeanu@linux.microsoft.com>
Cc: qemu-devel@nongnu.org, "Wei Liu" <liuwe@microsoft.com>,
"Wei Liu" <wei.liu@kernel.org>,
"Magnus Kulke" <magnuskulke@microsoft.com>,
"Doru Blânzeanu" <dblanzeanu@microsoft.com>
Subject: Re: [PATCH v2 4/4] accel/mshv: break the vCPU run loop on exit_request
Date: Wed, 23 Sep 2026 13:27:44 +0200 [thread overview]
Message-ID: <arO3sK51FSE7LyLD@example.com> (raw)
In-Reply-To: <20260731184643.89604-5-dblanzeanu@linux.microsoft.com>
On Fri, Jul 31, 2026 at 09:46:42PM +0300, Doru Blânzeanu wrote:
> Ignored VM exits can cause mshv_cpu_exec() to re-enter MSHV_RUN_VP
> without returning to qemu_process_cpu_events(). A busy vCPU may
> prevent pause_all_vcpus() from completing.
>
> Check exit_request before re-entering MSHV_RUN_VP and return
> EXCP_INTERRUPT so pending stop requests can be processed.
>
> Signed-off-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com>
> ---
> accel/mshv/mshv-all.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/accel/mshv/mshv-all.c b/accel/mshv/mshv-all.c
> index afcb87b3b8..b7c1126fe0 100644
> --- a/accel/mshv/mshv-all.c
> +++ b/accel/mshv/mshv-all.c
> @@ -780,6 +780,16 @@ static int mshv_cpu_exec(CPUState *cpu)
> cpu->vcpu_dirty = false;
> }
>
> + /*
> + * A kick/stop can't reliably break MSHV_RUN_VP out, so leave the run
> + * loop here too; otherwise a busy vCPU never reaches
> + * qemu_process_cpu_events() and pause_all_vcpus() hangs under the BQL.
> + */
> + if (cpu->stop || qatomic_load_acquire(&cpu->exit_request)) {
> + ret = EXCP_INTERRUPT;
> + break;
> + }
> +
> ret = mshv_run_vcpu(mshv_state->vm, cpu, &mshv_msg, &exit_reason);
> if (ret < 0) {
> error_report("Failed to run on vcpu %d", cpu->cpu_index);
> --
> 2.53.0
This is already fixed in upstream. checking the cpu->stop flag doesn't
seem to be required and other accelerators do not seem to check it
either. We agreed to drop this patch for now.
next prev parent reply other threads:[~2026-09-23 11:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 18:46 [PATCH v2 0/4] accel/mshv: add gdbstub guest debugging support Doru Blânzeanu
2026-07-31 18:46 ` [PATCH v2 1/4] include/hw/hyperv: add ABI for exception intercepts and pending events Doru Blânzeanu
2026-07-31 18:46 ` [PATCH v2 2/4] accel/mshv: add gdbstub software breakpoint support Doru Blânzeanu
2026-09-23 11:20 ` Magnus Kulke
2026-07-31 18:46 ` [PATCH v2 3/4] target/i386/mshv: support single-stepping Doru Blânzeanu
2026-07-31 18:46 ` [PATCH v2 4/4] accel/mshv: break the vCPU run loop on exit_request Doru Blânzeanu
2026-09-23 11:27 ` Magnus Kulke [this message]
2026-10-12 12:35 ` [PATCH v2 0/4] accel/mshv: add gdbstub guest debugging support Magnus Kulke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=arO3sK51FSE7LyLD@example.com \
--to=magnuskulke@linux.microsoft.com \
--cc=dblanzeanu@linux.microsoft.com \
--cc=dblanzeanu@microsoft.com \
--cc=liuwe@microsoft.com \
--cc=magnuskulke@microsoft.com \
--cc=qemu-devel@nongnu.org \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.