qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	qemu-s390x <qemu-s390x@nongnu.org>,
	"David Hildenbrand" <david@redhat.com>
Subject: Re: chacha20-s390 broken in 8.2.0 in TCG on s390x
Date: Wed, 17 Jan 2024 13:46:04 +0000	[thread overview]
Message-ID: <87mst4hy3n.fsf@draig.linaro.org> (raw)
In-Reply-To: <feb272b1-4729-4acf-8feb-5aed993a5a06@tls.msk.ru> (Michael Tokarev's message of "Wed, 17 Jan 2024 14:53:35 +0300")

Michael Tokarev <mjt@tls.msk.ru> writes:

> 04.01.2024 01:51, Richard Henderson :
>> On 1/4/24 01:37, Philippe Mathieu-Daudé wrote:
>>> Finally changing the constraints on op_rotli_vec seems to fix it:
>>>
>>> ---
>>> diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
>>> index fbee43d3b0..b3456fe857 100644
>>> --- a/tcg/s390x/tcg-target.c.inc
>>> +++ b/tcg/s390x/tcg-target.c.inc
>>> @@ -3264,13 +3264,13 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op)
>>>       case INDEX_op_ld_vec:
>>>       case INDEX_op_dupm_vec:
>>> +    case INDEX_op_rotli_vec:
>>>           return C_O1_I1(v, r);
>>>       case INDEX_op_dup_vec:
>>>           return C_O1_I1(v, vr);
>>>       case INDEX_op_abs_vec:
>>>       case INDEX_op_neg_vec:
>>>       case INDEX_op_not_vec:
>>> -    case INDEX_op_rotli_vec:
>>>       case INDEX_op_sari_vec:
>>>       case INDEX_op_shli_vec:
>>>       case INDEX_op_shri_vec:
>>>       case INDEX_op_s390_vuph_vec:
>>>       case INDEX_op_s390_vupl_vec:
>>>           return C_O1_I1(v, v);
>> Definitely not correct, since VERLL requires a vector input to be
>> rotated.
>> 
>>> But I'm outside of my comfort zone so not really sure what I'm doing...
>>> (I was inspired by the "the instruction verll only allows immediates up
>>> to 32 bits." comment from
>>> https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg317099.html)
>> That message is confused.  The immediate in VERLL is 12 bits (with
>> only 6 bits ever used for MO_64).  Dunno where "32 bits" comes from.
>
> So, what do we have here in the end?
> Should we fix this on qemu side?

I think the thinking is we should disable the optimisation for the 8.2
stable while figuring out the true fix for 9.0.

>
> This thread stopped quite some time ago, with problematic
> instruction found but no solution..
>
> Thanks,
>
> /mjt

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2024-01-17 13:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 14:51 chacha20-s390 broken in 8.2.0 in TCG on s390x Michael Tokarev
2024-01-03  0:22 ` Richard Henderson
2024-01-03  8:54   ` Michael Tokarev
2024-01-03 11:53     ` Philippe Mathieu-Daudé
2024-01-03 14:01       ` Philippe Mathieu-Daudé
2024-01-03 14:37         ` Philippe Mathieu-Daudé
2024-01-03 22:51           ` Richard Henderson
2024-01-17 11:53             ` Michael Tokarev
2024-01-17 13:46               ` Alex Bennée [this message]
2024-01-17 14:00               ` Philippe Mathieu-Daudé

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=87mst4hy3n.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=david@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).