qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-s390x: fix CC computation for EX instruc


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH] target-s390x: fix CC computation for EX instruction
Date: Mon, 18 May 2015 19:32:49 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-05-18 19:07, Alexander Graf wrote:
> On 05/18/2015 05:35 PM, Richard Henderson wrote:
> >On 05/16/2015 04:28 PM, Aurelien Jarno wrote:
> >>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.
> >>
> >>Cc: Richard Henderson <address@hidden>
> >>Cc: Alexander Graf <address@hidden>
> >>Signed-off-by: Aurelien Jarno <address@hidden>
> >>---
> >>  target-s390x/translate.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >>diff --git a/target-s390x/translate.c b/target-s390x/translate.c
> >>index 80e3a54..10522df 100644
> >>--- a/target-s390x/translate.c
> >>+++ b/target-s390x/translate.c
> >>@@ -2095,7 +2095,7 @@ 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);
> >I agree this is a bug, and the right fix.
> >
> >You can also remove the set_cc_static at the end of op_ex, since that's done 
> >by
> >gen_op_calc_cc.
> 
> Thanks, I applied the patch and did the change to remove set_cc_static from
> op_ex locally.

Thanks!

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

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