qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 3/3] tcg-runtime: short-circuit lookup_tb_ptr


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v1 3/3] tcg-runtime: short-circuit lookup_tb_ptr on IRQs
Date: Wed, 14 Jun 2017 18:08:10 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0


On 14/06/2017 17:45, Richard Henderson wrote:
> While the next TB would detect the exit flag has been set there is no
> point if we can exit sooner. We also check cpu->interrupt_request as
> some front-ends can set it rather than using the cpu_interrupt() API
> call and would normally be expecting the IRQ to get picked up on the
> previously fairly regular exits from the run loop. 

This is not what happens actually; it's not about front-ends setting 
cpu->interrupt_request, it's about front-ends doing exit_tb when they 
wanted to re-evaluate cpu_handle_interrupt.

cpu_exit is used when device code causes a rising edge in 
cpu->interrupt_request.  What we have here is that the MSR write causes 
cc->cpu_exec_interrupt's return value to change from false to true.

I think this is a band-aid, and would rather fix the front-ends as in 
Emilio's patch.  For Alpha my guess would be:

diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 7c45ae360c..6e2ee3f958 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -1198,7 +1198,9 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int 
palcode)
             tcg_gen_andi_i64(tmp, ctx->ir[IR_A0], PS_INT_MASK);
              tcg_gen_st8_i64(tmp, cpu_env, offsetof(CPUAlphaState, ps));
             tcg_temp_free(tmp);
-            break;
+
+            /* Reevaluate interrupts */
+            return EXIT_PC_STALE;
 
         case 0x36:
             /* RDPS */


It's okay as a last resort I guess, but there's still a lot of
time before 2.9.

Paolo



reply via email to

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