qemu-stable
[Top][All Lists]
Advanced

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

Re: [Qemu-stable] [PATCH 1/2] win32: do not set CPU affinity


From: Paolo Bonzini
Subject: Re: [Qemu-stable] [PATCH 1/2] win32: do not set CPU affinity
Date: Wed, 20 Feb 2013 15:59:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 20/02/2013 15:49, Peter Maydell ha scritto:
> On 20 February 2013 14:43, Laszlo Ersek <address@hidden> wrote:
>> On 02/20/13 14:43, Paolo Bonzini wrote:
>>> QEMU system emulation has been thread-safe for a long time
> 
> Says who? cpu_interrupt() calls tcg_handle_interrupt()
> which calls cpu_unlink_tb() which makes changes to the
> TB datastructure with no kind of locking at all.

But in system emulation mode, cpu_interrupt is always running under the
iothread lock.

cpu_exit is more interesting because it calls cpu_unlink_tb() outside
the iothread lock.  However, it does this in a signal handler running in
the CPU thread (or, in Windows, wrapped with
SuspendThread/ResumeThread).  So it "only" needs to be
async-signal-safe, not thread-safe.

Paolo

> I'm actually working on a patchset which fixes this
> (by having every TCG TB check the exit_request flag at
> the start and exit if set, so we can throw out cpu_unlink_tb()
> entirely), but as of right now the codebase is definitely
> not threadsafe.



reply via email to

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