From: Paolo Bonzini <pbonzini@redhat.com>
To: "Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>,
"Emilio G. Cota" <cota@braap.org>
Subject: Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop()
Date: Tue, 2 Oct 2018 10:58:26 +0200 [thread overview]
Message-ID: <021f3f1e-e767-8d84-0189-fbfa7ca5f143@redhat.com> (raw)
In-Reply-To: <CAFEAcA8ZW_rDyUg0G+agmBfNc8dNVc7r1pdu-Tyb6cvLXdvzHw@mail.gmail.com>
On 02/10/2018 10:01, Peter Maydell wrote:
> On 1 October 2018 at 19:12, Alex Bennée <alex.bennee@linaro.org> wrote:
>> I would have thought the reset code should be scheduled via safe async
>> work to run in the vCPU context. Why should the main loop get involved
>> at all here?
> The reset code is much older than the safe-async support for
> running things in the vCPU context... Also, does the safe
> async support work with KVM/HAX/Hypervisor.Framework? The
> reset code has to handle all those, not just TCG.
>
> Plus, which vCPU thread would you use? We're resetting
> the entire system, so privileging an arbitrary vCPU
> thread to do that doesn't seem any less odd than using
> the main loop thread.
I think there's two parts in this.
First, the reset code should indeed use run_on_cpu (it need not be safe
i.e. stop-the-world; just run it in the vCPU thread). It certainly
doesn't do this right now.
Second, when run_on_cpu's callback runs we should make sure that
cpu_can_run() is false. I think that's already the case, but it's worth
asserting.
Paolo
next prev parent reply other threads:[~2018-10-02 8:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-01 17:03 [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop() Peter Maydell
2018-10-01 18:12 ` Alex Bennée
2018-10-02 8:01 ` Peter Maydell
2018-10-02 8:58 ` Paolo Bonzini [this message]
2018-10-02 9:04 ` Peter Maydell
2018-10-02 9:59 ` Paolo Bonzini
2018-10-02 10:34 ` Peter Maydell
2018-10-02 16:46 ` Paolo Bonzini
2018-10-02 16:57 ` Peter Maydell
2018-10-02 10:00 ` Alex Bennée
2018-10-02 10:31 ` Peter Maydell
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=021f3f1e-e767-8d84-0189-fbfa7ca5f143@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 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).