[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: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop() |
Date: |
Tue, 2 Oct 2018 11:34:54 +0100 |
On 2 October 2018 at 10:59, Paolo Bonzini <address@hidden> wrote:
> On 02/10/2018 11:04, Peter Maydell wrote:
>> On 2 October 2018 at 09:58, Paolo Bonzini <address@hidden> wrote:
>>>
>>> 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.
>>
>> I don't understand this part. We're resetting the entire world:
>> surely we need to stop the entire world first ?
>
> Most of the world is stopped because it only runs with BQL taken. vCPU
> isn't, so we ensure it is stopped by: 1) using run_on_cpu to synchronize
> with the executed TBs (or KVM_RUN) 2) ensuring the execution loop is
> paused after reset, which is the cpu_can_run part that you snipped.
Maybe I just don't understand what you're suggesting should be
done via run-on-cpu. But it seems to me that the problem here
is that cpu_stop_current() should not call qemu_cpu_stop()
immediately, but instead arrange that this vCPU calls qemu_cpu_stop()
when it gets back out of the execution loop.
thanks
-- PMM
- [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Peter Maydell, 2018/10/01
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Alex Bennée, 2018/10/01
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Peter Maydell, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Paolo Bonzini, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Peter Maydell, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Paolo Bonzini, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(),
Peter Maydell <=
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Paolo Bonzini, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Peter Maydell, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Alex Bennée, 2018/10/02
- Re: [Qemu-devel] racing between pause_all_vcpus() and qemu_cpu_stop(), Peter Maydell, 2018/10/02