diff mbox

[v2] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()

Message ID 1463071937-26607-1-git-send-email-sergey.fedorov@linaro.org
State New
Headers show

Commit Message

sergey.fedorov@linaro.org May 12, 2016, 4:52 p.m. UTC
From: Sergey Fedorov <serge.fdrv@gmail.com>

Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
---

This patch applies on top of commit:
    40ae3669fb55 ("cpu-exec: Remove unused 'x86_cpu' and 'env' from cpu_exec()")
from:
    git://github.com/rth7680/qemu.git tcg-next

Changes in v2:
 * Reload only when target hook called

 cpu-exec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Richard Henderson May 12, 2016, 5:05 p.m. UTC | #1
On 05/12/2016 06:52 AM, Sergey Fedorov wrote:
> From: Sergey Fedorov <serge.fdrv@gmail.com>
>
> Suggested-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
> Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
> ---
>
> This patch applies on top of commit:
>     40ae3669fb55 ("cpu-exec: Remove unused 'x86_cpu' and 'env' from cpu_exec()")
> from:
>     git://github.com/rth7680/qemu.git tcg-next
>
> Changes in v2:
>  * Reload only when target hook called

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/cpu-exec.c b/cpu-exec.c
index 0ea47e997dfa..14df1aacf42a 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -488,10 +488,11 @@  static inline void cpu_handle_interrupt(CPUState *cpu,
             if (cc->cpu_exec_interrupt(cpu, interrupt_request)) {
                 *last_tb = NULL;
             }
+            /* The target hook may have updated the 'cpu->interrupt_request';
+             * reload the 'interrupt_request' value */
+            interrupt_request = cpu->interrupt_request;
         }
-        /* Don't use the cached interrupt_request value,
-           do_interrupt may have updated the EXITTB flag. */
-        if (cpu->interrupt_request & CPU_INTERRUPT_EXITTB) {
+        if (interrupt_request & CPU_INTERRUPT_EXITTB) {
             cpu->interrupt_request &= ~CPU_INTERRUPT_EXITTB;
             /* ensure that no TB jump will be modified as
                the program flow was changed */