[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] cpus.c: Fix race condition in cpu_stop_current(
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] cpus.c: Fix race condition in cpu_stop_current() |
Date: |
Mon, 10 Dec 2018 13:07:14 +0000 |
On Mon, 10 Dec 2018 at 12:15, Alex Bennée <address@hidden> wrote:
> Peter Maydell <address@hidden> writes:
> > though I might actually have meant pause_all_vcpus().
> > (For pause_all_vcpus() I think the correct thing is to
> > fix the hw/i386/kvmvapic.c code to work in some other way,
> > and then assert that pause_all_vcpus() is never called from
> > the VCPU thread.)
>
> I thought we had already fixed this, but it is yet another case. See the
> patch_instruction code in the same file. The only niggle is ensuring
> that either the helper is called from last instruction in the block or
> forcing a cpu_exit after queuing the work.
Note that the call to pause_all_vcpus() is inside an
"if (kvm_enabled())" so it doesn't matter what the TCG
code does in the way of dividing code up into blocks.
(Though the comment suggests that making it work in TCG
might be nice in theory.)
thanks
-- PMM