qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/31] target/s390x: Implement EXECUTE via new T


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 02/31] target/s390x: Implement EXECUTE via new TranslationBlock
Date: Wed, 24 May 2017 14:45:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 05/24/2017 10:54 AM, Aurelien Jarno wrote:
It seems the problem arise if an interrupt happens when the TB
containing the EXECUTE instruction is being executed. In that case at
the end of the TB, the interruption code is translated with the ex_value
set, which means with the wrong PC, wrong permissions and wrong return
address.

This is the same kind of issue I identified on SH4 recently:
https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg03880.html

The same king of solution also works, that is disabling the interrupts
when the ex_value is set:

diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 6f81b1a16c..a33abdef16 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -655,6 +657,10 @@ bool s390_cpu_exec_interrupt(CPUState *cs, int 
interrupt_request)
          S390CPU *cpu = S390_CPU(cs);
          CPUS390XState *env = &cpu->env;
+ if (env->ex_value) {
+            return false;
+        }
+
          if (env->psw.mask & PSW_MASK_EXT) {
              s390_cpu_do_interrupt(cs);
              return true;


Thanks for the research.  I've incorporated this into my patch set.


r~



reply via email to

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