qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt handling out of cp


From: Sergey Fedorov
Subject: Re: [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt handling out of cpu_exec()
Date: Tue, 10 May 2016 22:24:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 10/05/16 19:34, Richard Henderson wrote:
> On 05/10/2016 05:46 AM, Sergey Fedorov wrote:
>> From: Sergey Fedorov <address@hidden>
>>
>> Simplify cpu_exec() by extracting interrupt handling code outside of
>> cpu_exec() into a new static inline function cpu_handle_interrupt().
>>
>> Signed-off-by: Sergey Fedorov <address@hidden>
>> Signed-off-by: Sergey Fedorov <address@hidden>
>> ---
>>  cpu-exec.c | 132
>> ++++++++++++++++++++++++++++++++-----------------------------
>>  1 file changed, 70 insertions(+), 62 deletions(-)
>
> Reviewed-by: Richard Henderson  <address@hidden>
>
>
>> +        if (replay_mode == REPLAY_MODE_PLAY &&
>> !replay_has_interrupt()) {
>> +            /* Do nothing */
>> +        } else if (interrupt_request & CPU_INTERRUPT_HALT) {
>> +        }
>> +        else if (interrupt_request & CPU_INTERRUPT_RESET) {
>> +        }
>> +        else {
>> +            replay_interrupt();
>> +            if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
>> +                *last_tb = NULL;
>> +            }
>> +        }
>> +        /* Don't use the cached interrupt_request value,
>> +           do_interrupt may have updated the EXITTB flag. */
>> +        if (cpu->interrupt_request & CPU_INTERRUPT_EXITTB) {
>
> Note for future cleanup: IMO this comment is cleaner if it's actually
> put where it's meaningful (and updated to reflect that do_interrupt no
> longer exists).  E.g.
>
>     else {
>     if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
>         *last_tb = NULL;
>     }
>     /* Reload the interrupt_request value as it may have
>        been updated by the target hook.  */
>     interrupt_request = cpu->interrupt_request;
>     }
>     if (interupt_request & CPU_INTERRUPT_EXITTB) {
>     ...
>
> But such a change of course belongs in a separate patch.

Cool, thanks for the suggestion. I've had feeling this could be
expressed in a better way, like you suggest :)

Kind regards,
Sergey



reply via email to

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