]> xenbits.xensource.com Git - qemu-xen-unstable.git/commitdiff
target-s390x: fix CC computation for EX instruction
authorAurelien Jarno <aurelien@aurel32.net>
Sat, 16 May 2015 23:28:03 +0000 (01:28 +0200)
committerAlexander Graf <agraf@suse.de>
Thu, 4 Jun 2015 23:37:57 +0000 (01:37 +0200)
Commit 7a6c7067f optimized CC computation by only saving cc_op before
calling helpers as they either don't touch the CC or generate a new
static value. This however doesn't work for the EX instruction as the
helper changes or not the CC value depending on the actual executed
instruction (e.g. MVC vs CLC).

This patches force a CC computation before calling the helper. This
fixes random memory corruption occuring in guests.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
[agraf: remove set_cc_static in op_ex as suggested by rth]
Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x/translate.c

index fbffd3066dfab5e2f1b7f6fe5ce7ce6dc3de64f2..497733dbcc842f95bb7c1dd08331dbe596ea9f9d 100644 (file)
@@ -2101,13 +2101,12 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o)
     TCGv_i64 tmp;
 
     update_psw_addr(s);
-    update_cc_op(s);
+    gen_op_calc_cc(s);
 
     tmp = tcg_const_i64(s->next_pc);
     gen_helper_ex(cc_op, cpu_env, cc_op, o->in1, o->in2, tmp);
     tcg_temp_free_i64(tmp);
 
-    set_cc_static(s);
     return NO_EXIT;
 }