From: Alexander Graf <agraf@suse.de>
To: Richard Henderson <rth@twiddle.net>,
Aurelien Jarno <aurelien@aurel32.net>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target-s390x: fix CC computation for EX instruction
Date: Mon, 18 May 2015 19:07:21 +0200 [thread overview]
Message-ID: <555A1C49.4030303@suse.de> (raw)
In-Reply-To: <555A06DC.7030608@twiddle.net>
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 <rth@twiddle.net>
>> Cc: Alexander Graf <agraf@suse.de>
>> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
>> ---
>> 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.
Alex
next prev parent reply other threads:[~2015-05-18 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-16 23:28 [Qemu-devel] [PATCH] target-s390x: fix CC computation for EX instruction Aurelien Jarno
2015-05-18 13:18 ` Alexander Graf
2015-05-18 15:35 ` Richard Henderson
2015-05-18 17:07 ` Alexander Graf [this message]
2015-05-18 17:32 ` Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=555A1C49.4030303@suse.de \
--to=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.