[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: |
Thu, 29 Jan 2015 10:44:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
On 22/01/2015 09:52, Pavel Dovgalyuk wrote:
> + if (replay_mode == REPLAY_MODE_RECORD) {
> + replay_save_instructions();
> + replay_put_event(EVENT_EXCEPTION);
> + return true;
Missing mutex lock/unlock.
> + } else if (replay_mode == REPLAY_MODE_PLAY) {
> + bool res = false;
> + replay_exec_instructions();
> + replay_mutex_lock();
> + if (skip_async_events(EVENT_EXCEPTION)) {
> + replay_has_unread_data = 0;
> + res = true;
> + }
> + replay_mutex_unlock();
> + return res;
> + }
bool res;
replay_exec_instructions();
res = replay_has_exception();
if (res) {
replay_has_unread_data = 0;
}
return res;
Same for replay_interrupt().
Perhaps worth factoring out two functions replay_cpu_event and
replay_has_cpu_event? You choose.
>
> @@ -1294,6 +1295,9 @@ bool x86_cpu_exec_interrupt(CPUState *cs, int
> interrupt_request)
> if (interrupt_request & CPU_INTERRUPT_POLL) {
> cs->interrupt_request &= ~CPU_INTERRUPT_POLL;
> apic_poll_irq(cpu->apic_state);
> + if (replay_mode != REPLAY_MODE_NONE) {
> + return true;
> + }
> }
> #endif
Can you explain this? It probably needs a comment.
Paolo
- [Qemu-devel] [RFC PATCH v8 05/21] replay: introduce mutex to protect the replay log, (continued)
- [Qemu-devel] [RFC PATCH v8 05/21] replay: introduce mutex to protect the replay log, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 04/21] replay: internal functions for replay log, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 06/21] replay: introduce icount event, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 07/21] cpu-exec: allow temporary disabling icount, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 08/21] cpu: replay instructions sequence, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 09/21] replay: interrupts and exceptions, Pavel Dovgalyuk, 2015/01/22
- Re: [Qemu-devel] [RFC PATCH v8 09/21] replay: interrupts and exceptions,
Paolo Bonzini <=
- [Qemu-devel] [RFC PATCH v8 10/21] replay: asynchronous events infrastructure, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 11/21] replay: recording and replaying clock ticks, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 12/21] replay: recording and replaying different timers, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 13/21] replay: shutdown event, Pavel Dovgalyuk, 2015/01/22
- [Qemu-devel] [RFC PATCH v8 15/21] aio: replace stack of bottom halves with queue, Pavel Dovgalyuk, 2015/01/22