[PATCH 0/2] tcg/s390x: Fix chacha20-s390

Richard Henderson posted 2 patches 8 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20240117213646.159697-1-richard.henderson@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>
tests/tcg/s390x/chacha.c        | 341 ++++++++++++
tcg/s390x/tcg-target.c.inc      |   6 +-
tests/tcg/s390x/Makefile.target |   4 +
tests/tcg/s390x/chacha-vx.S     | 914 ++++++++++++++++++++++++++++++++
4 files changed, 1262 insertions(+), 3 deletions(-)
create mode 100644 tests/tcg/s390x/chacha.c
create mode 100644 tests/tcg/s390x/chacha-vx.S
[PATCH 0/2] tcg/s390x: Fix chacha20-s390
Posted by Richard Henderson 8 months, 1 week ago
So it turns out the regression exposed by "Optimize env memory operations"
is caused by an s390x host encoding error.  This is the first time that we
have had sufficient register pressure to use more than a few vector
registers at the same time.

As such, the testcase itself is interesting, since nothing else in our
testsuite generates translation blocks with quite so many vector insns
with more than 16 simultaneously live values.


r~


Richard Henderson (2):
  tcg/s390x: Fix encoding of VRIc, VRSa, VRSc insns
  tests/tcg/s390x: Import linux tools/testing/crypto/chacha20-s390

 tests/tcg/s390x/chacha.c        | 341 ++++++++++++
 tcg/s390x/tcg-target.c.inc      |   6 +-
 tests/tcg/s390x/Makefile.target |   4 +
 tests/tcg/s390x/chacha-vx.S     | 914 ++++++++++++++++++++++++++++++++
 4 files changed, 1262 insertions(+), 3 deletions(-)
 create mode 100644 tests/tcg/s390x/chacha.c
 create mode 100644 tests/tcg/s390x/chacha-vx.S

-- 
2.34.1
Re: [PATCH 0/2] tcg/s390x: Fix chacha20-s390
Posted by Michael Tokarev 8 months ago
18.01.2024 00:36, Richard Henderson:
> So it turns out the regression exposed by "Optimize env memory operations"
> is caused by an s390x host encoding error.  This is the first time that we
> have had sufficient register pressure to use more than a few vector
> registers at the same time.
> 
> As such, the testcase itself is interesting, since nothing else in our
> testsuite generates translation blocks with quite so many vector insns
> with more than 16 simultaneously live values.

Tested-by: Michael Tokarev <mjt@tls.msk.ru>

Both changes - the fix and the testsuite.  With several (debian) kernels on
actual s390x hw and on a few other architectures as well.

Why the problem didn't occur on non-s390x *host*?  As I noted in my initial
email, the testcase worked on amd64 host but not on s390x host..

Thank you for the good work Richard!

/mjt
Re: [PATCH 0/2] tcg/s390x: Fix chacha20-s390
Posted by Richard Henderson 8 months ago
On 1/18/24 17:07, Michael Tokarev wrote:
> Why the problem didn't occur on non-s390x *host*?  As I noted in my initial
> email, the testcase worked on amd64 host but not on s390x host..

Because the error was in the s390x host tcg backend.


r~