cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
PATCH 1/1 cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
From: Sergey Fedorov <[email protected]>
Suggested-by Richard Henderson <[email protected]>
Signed-off-by Sergey Fedorov <[email protected]>
Signed-off-by Sergey Fedorov <[email protected]>
---
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-nextcpu-exec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
cpu-exec.c +4 -3
@@ -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 */
Signature · 1 line
1.9.1
cpu-exec.c static inline void cpu_handle_interrupt(CPUState *cpu, · line 490
Quoted 3 lines · Sergey Fedorov
cpu-exec.c +0
-0@@ -489,9 +489,10 @@ static inline void cpu_handle_interrupt(CPUState *cpu, *last_tb =NULL ; }
[A]
cpu-exec.c static inline void cpu_handle_interrupt(CPUState *cpu, · line 495
Quoted 8 lines
cpu-exec.c +4
-3} -/* 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 ) {
Actually I suggested reloading it after the only place it could have changed, at A.
r~
Quoted 18 lines · Richard Henderson
cpu-exec.c static inline void cpu_handle_interrupt(CPUState · line 491
Quoted 4 lines · Sergey Fedorov
cpu-exec.c +0
-0@@ -489,9 +489,10 @@ static inline void cpu_handle_interrupt(CPUState *cpu, *last_tb =NULL ; }[A]
cpu-exec.c static inline void cpu_handle_interrupt(CPUState *cpu, · line 495
Quoted 9 lines
cpu-exec.c +4
-3} -/* 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 ) {
Quoted 2 lines
Actually I suggested reloading it after the only place it could have changed, at A.
Oops :) Will fix it and resend.
Thanks,
Sergey