[Top][All Lists]

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

Re: [Qemu-devel] [RFC PATCH v8 09/21] replay: interrupts and exceptions

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC PATCH v8 09/21] replay: interrupts and exceptions
Date: Mon, 02 Feb 2015 15:18:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/02/2015 14:50, Pavel Dovgaluk wrote:
> I think not. We just have to write number of already executed instructions.
> This number is not linked to exception event. They could be read in replay 
> while
> processing some other event.

I was referring to replay_put_event(EVENT_EXCEPTION) only.

In principle you could run EVENT_EXCEPTION concurrently with other event
writes, for example:

+        replay_mutex_lock();
+        replay_put_event(EVENT_CLOCK + kind);
+        replay_put_qword(clock);
+        replay_mutex_unlock();

and get

        EVENT_CLOCK + kind (1 byte)
        EVENT_EXCEPTION (1 byte)
        clock (8 bytes)

in the replay stream.

I know it's really unlikely, perhaps even impossible in the current QEMU
architecture that is dominated by the big QEMU lock.  But the right
thing to do is to lock the mutex around all event writes.  Even if the
write itself is atomic, it could happen in the middle of another write
if you do not lock the mutex.


reply via email to

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