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: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 3/5] cpu-exec: Move interrupt handling out of cpu_exec()
Date: Tue, 10 May 2016 06:34:19 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

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.


r~



reply via email to

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