qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 04/14] icount: exit cpu loop on expire


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v7 04/14] icount: exit cpu loop on expire
Date: Wed, 25 Jan 2017 13:00:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 25/01/2017 12:50, Pavel Dovgalyuk wrote:
>>> +                /* icount has expired, we need to break the execution loop.
>>> +                   This check is needed before tb_find to make execution
>>> +                   deterministic - tb_find may cause an exception
>>> +                   while translating the code from non-mapped page. */
>>> +                if (use_icount && ((cpu->icount_extra == 0
>>> +                                    && cpu->icount_decr.u16.low == 0)
>>> +                                || (int32_t)cpu->icount_decr.u32 < 0)) {
>>> +                    if (cpu->exception_index == -1) {
>>> +                        cpu->exception_index = EXCP_INTERRUPT;
>>> +                    }
>>> +                    cpu_loop_exit(cpu);
>>> +                }
>> Can this can be placed in cpu_handle_interrupt itself?  
> I guess it could. I placed it here because it doesn't related to interrupts.

True, on the other hand neither is

    if (unlikely(atomic_read(&cpu->exit_request) || replay_has_interrupt())) {
        atomic_set(&cpu->exit_request, 0);
        cpu->exception_index = EXCP_INTERRUPT;
        cpu_loop_exit(cpu);
    }

Except for the replay_has_interrupt() that you added, but I don't understand
that one either...

Paolo



reply via email to

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