From: Sergey Fedorov <serge.f...@gmail.com>

Suggested-by: Richard Henderson <r...@twiddle.net>
Signed-off-by: Sergey Fedorov <serge.f...@gmail.com>
Signed-off-by: Sergey Fedorov <sergey.fedo...@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

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

diff --git a/cpu-exec.c b/cpu-exec.c
index 0ea47e997dfa..a7b03f77cf53 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -489,9 +489,10 @@ static inline void cpu_handle_interrupt(CPUState *cpu,
                 *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) {
+        /* The target hook may have updated the 'cpu->interrupt_request';
+         * reload the 'interrupt_request' value */
+        interrupt_request = cpu->interrupt_request;
+        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 */
-- 
1.9.1


Reply via email to