qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
@ 2016-05-12 14:14 Sergey Fedorov
  2016-05-12 16:47 ` Richard Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Fedorov @ 2016-05-12 14:14 UTC (permalink / raw)
  To: qemu-devel
  Cc: Sergey Fedorov, Sergey Fedorov, Paolo Bonzini, Peter Crosthwaite,
	Richard Henderson

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

 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
  2016-05-12 14:14 [Qemu-devel] [PATCH] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt() Sergey Fedorov
@ 2016-05-12 16:47 ` Richard Henderson
  2016-05-12 16:49   ` Sergey Fedorov
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2016-05-12 16:47 UTC (permalink / raw)
  To: Sergey Fedorov, qemu-devel
  Cc: Sergey Fedorov, Paolo Bonzini, Peter Crosthwaite

On 05/12/2016 04:14 AM, Sergey Fedorov wrote:
> @@ -489,9 +489,10 @@ static inline void cpu_handle_interrupt(CPUState *cpu,
>                  *last_tb = NULL;
>              }

[A]

>          }
> -        /* 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~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt()
  2016-05-12 16:47 ` Richard Henderson
@ 2016-05-12 16:49   ` Sergey Fedorov
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Fedorov @ 2016-05-12 16:49 UTC (permalink / raw)
  To: Richard Henderson, Sergey Fedorov, qemu-devel
  Cc: Paolo Bonzini, Peter Crosthwaite

On 12/05/16 19:47, Richard Henderson wrote:
> On 05/12/2016 04:14 AM, Sergey Fedorov wrote:
>> @@ -489,9 +489,10 @@ static inline void cpu_handle_interrupt(CPUState
>> *cpu,
>>                  *last_tb = NULL;
>>              }
>
> [A]
>
>>          }
>> -        /* 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.

Oops :) Will fix it and resend.

Thanks,
Sergey

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-12 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 14:14 [Qemu-devel] [PATCH] cpu-exec: Clean up 'interrupt_request' reloading in cpu_handle_interrupt() Sergey Fedorov
2016-05-12 16:47 ` Richard Henderson
2016-05-12 16:49   ` Sergey Fedorov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).