diff mbox

[28/31] target/s390x: Use unwind data for helper_lra

Message ID 20170523030312.6360-29-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson May 23, 2017, 3:03 a.m. UTC
Note that exception_index is not live during a TB,
so there is no point saving it around mmu_translate.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/s390x/mem_helper.c | 4 +---
 target/s390x/translate.c  | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

Aurelien Jarno May 23, 2017, 12:11 p.m. UTC | #1
On 2017-05-22 20:03, Richard Henderson wrote:
> Note that exception_index is not live during a TB,
> so there is no point saving it around mmu_translate.

What do you mean by "is not live"? Indeed cpu_loop_exit() is not called
so the TB is not terminated immediately. That said the while loop in
cpu_exec() will trigger the exception after the TB.
Richard Henderson May 23, 2017, 4:22 p.m. UTC | #2
On 05/23/2017 05:11 AM, Aurelien Jarno wrote:
> On 2017-05-22 20:03, Richard Henderson wrote:
>> Note that exception_index is not live during a TB,
>> so there is no point saving it around mmu_translate.
> 
> What do you mean by "is not live"? Indeed cpu_loop_exit() is not called
> so the TB is not terminated immediately. That said the while loop in
> cpu_exec() will trigger the exception after the TB.
> 

Ah, yes.  I'll undo that bit.


r~
diff mbox

Patch

diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
index 7f22bf0..81b27c0 100644
--- a/target/s390x/mem_helper.c
+++ b/target/s390x/mem_helper.c
@@ -1181,17 +1181,16 @@  uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr)
 {
     CPUState *cs = CPU(s390_env_get_cpu(env));
     uint32_t cc = 0;
-    int old_exc = cs->exception_index;
     uint64_t asc = env->psw.mask & PSW_MASK_ASC;
     uint64_t ret;
     int flags;
 
     /* XXX incomplete - has more corner cases */
     if (!(env->psw.mask & PSW_MASK_64) && (addr >> 32)) {
+        cpu_restore_state(cs, GETPC());
         program_interrupt(env, PGM_SPECIAL_OP, 2);
     }
 
-    cs->exception_index = old_exc;
     if (mmu_translate(env, addr, 0, asc, &ret, &flags, true)) {
         cc = 3;
     }
@@ -1200,7 +1199,6 @@  uint64_t HELPER(lra)(CPUS390XState *env, uint64_t addr)
     } else {
         ret |= addr & ~TARGET_PAGE_MASK;
     }
-    cs->exception_index = old_exc;
 
     env->cc_op = cc;
     return ret;
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 282fa27..3e4b397 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -2565,7 +2565,6 @@  static ExitStatus op_lctlg(DisasContext *s, DisasOps *o)
 static ExitStatus op_lra(DisasContext *s, DisasOps *o)
 {
     check_privileged(s);
-    potential_page_fault(s);
     gen_helper_lra(o->out, cpu_env, o->in2);
     set_cc_static(s);
     return NO_EXIT;