qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

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