qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop()


From: Paolo Bonzini
Subject: Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop()
Date: Tue, 2 Oct 2018 10:58:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 02/10/2018 10:01, Peter Maydell wrote:
> On 1 October 2018 at 19:12, Alex Bennée <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]