* [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
@ 2022-03-09 11:22 Alex Bennée
2022-03-09 11:23 ` David Hildenbrand
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Alex Bennée @ 2022-03-09 11:22 UTC (permalink / raw)
To: qemu-devel
Cc: Thomas Huth, David Hildenbrand, Cornelia Huck, Richard Henderson,
open list:S390 TCG CPUs, Alex Bennée
With -cpu max we get a warning:
qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
But dropping the -cpu max and it still runs fine.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: Thomas Huth <thuth@redhat.com>
---
tests/tcg/s390x/Makefile.target | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index 257c568c58..7aa502a557 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
sha512-mvx: sha512.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
-run-sha512-mvx: QEMU_OPTS+=-cpu max
-
TESTS+=sha512-mvx
--
2.30.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-09 11:22 [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation Alex Bennée
@ 2022-03-09 11:23 ` David Hildenbrand
2022-03-09 20:44 ` Richard Henderson
2022-03-10 8:36 ` Thomas Huth
2 siblings, 0 replies; 10+ messages in thread
From: David Hildenbrand @ 2022-03-09 11:23 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Thomas Huth, Cornelia Huck, Richard Henderson,
open list:S390 TCG CPUs
On 09.03.22 12:22, Alex Bennée wrote:
> With -cpu max we get a warning:
>
> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>
> But dropping the -cpu max and it still runs fine.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Thomas Huth <thuth@redhat.com>
> ---
> tests/tcg/s390x/Makefile.target | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
> index 257c568c58..7aa502a557 100644
> --- a/tests/tcg/s390x/Makefile.target
> +++ b/tests/tcg/s390x/Makefile.target
> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
> sha512-mvx: sha512.c
> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>
> -run-sha512-mvx: QEMU_OPTS+=-cpu max
> -
> TESTS+=sha512-mvx
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-09 11:22 [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation Alex Bennée
2022-03-09 11:23 ` David Hildenbrand
@ 2022-03-09 20:44 ` Richard Henderson
2022-03-10 8:36 ` Thomas Huth
2 siblings, 0 replies; 10+ messages in thread
From: Richard Henderson @ 2022-03-09 20:44 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Thomas Huth, Cornelia Huck, open list:S390 TCG CPUs,
David Hildenbrand
On 3/9/22 01:22, Alex Bennée wrote:
> With -cpu max we get a warning:
>
> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>
> But dropping the -cpu max and it still runs fine.
>
> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
> Cc: Thomas Huth<thuth@redhat.com>
> ---
> tests/tcg/s390x/Makefile.target | 2 --
> 1 file changed, 2 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-09 11:22 [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation Alex Bennée
2022-03-09 11:23 ` David Hildenbrand
2022-03-09 20:44 ` Richard Henderson
@ 2022-03-10 8:36 ` Thomas Huth
2022-03-10 10:21 ` Thomas Huth
2022-03-10 10:34 ` Alex Bennée
2 siblings, 2 replies; 10+ messages in thread
From: Thomas Huth @ 2022-03-10 8:36 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: open list:S390 TCG CPUs, Cornelia Huck, Richard Henderson,
David Hildenbrand
On 09/03/2022 12.22, Alex Bennée wrote:
> With -cpu max we get a warning:
>
> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>
> But dropping the -cpu max and it still runs fine.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: Thomas Huth <thuth@redhat.com>
> ---
> tests/tcg/s390x/Makefile.target | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
> index 257c568c58..7aa502a557 100644
> --- a/tests/tcg/s390x/Makefile.target
> +++ b/tests/tcg/s390x/Makefile.target
> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
> sha512-mvx: sha512.c
> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>
> -run-sha512-mvx: QEMU_OPTS+=-cpu max
> -
> TESTS+=sha512-mvx
Ok, this helps to get rid of the warnings, thus feel free to add:
Tested-by: Thomas Huth <thuth@redhat.com>
However, the error still persists. I now had a closer look by running the
test with "qemu-s390x" on my z15 machine directly, and all tests are
failing! The problem happens with both, gcc v11.2.1 and clang v13.0.1. The
problem goes away (i.e. test works fine) if I compile the code with -O1
instead of -O3, or if I use GCC v8.5 instead. I'll try to find out more, but
as a temporary workaround, we could also switch to -O1 instead of -O3.
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-10 8:36 ` Thomas Huth
@ 2022-03-10 10:21 ` Thomas Huth
2022-03-10 11:35 ` Richard Henderson
2022-03-10 10:34 ` Alex Bennée
1 sibling, 1 reply; 10+ messages in thread
From: Thomas Huth @ 2022-03-10 10:21 UTC (permalink / raw)
To: Alex Bennée, qemu-devel, Richard Henderson
Cc: open list:S390 TCG CPUs, Cornelia Huck, Dr. David Alan Gilbert,
David Hildenbrand
On 10/03/2022 09.36, Thomas Huth wrote:
> On 09/03/2022 12.22, Alex Bennée wrote:
>> With -cpu max we get a warning:
>>
>> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>>
>> But dropping the -cpu max and it still runs fine.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Cc: Thomas Huth <thuth@redhat.com>
>> ---
>> tests/tcg/s390x/Makefile.target | 2 --
>> 1 file changed, 2 deletions(-)
>>
>> diff --git a/tests/tcg/s390x/Makefile.target
>> b/tests/tcg/s390x/Makefile.target
>> index 257c568c58..7aa502a557 100644
>> --- a/tests/tcg/s390x/Makefile.target
>> +++ b/tests/tcg/s390x/Makefile.target
>> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
>> sha512-mvx: sha512.c
>> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>> -run-sha512-mvx: QEMU_OPTS+=-cpu max
>> -
>> TESTS+=sha512-mvx
>
> Ok, this helps to get rid of the warnings, thus feel free to add:
>
> Tested-by: Thomas Huth <thuth@redhat.com>
>
> However, the error still persists. I now had a closer look by running the
> test with "qemu-s390x" on my z15 machine directly, and all tests are
> failing! The problem happens with both, gcc v11.2.1 and clang v13.0.1. The
> problem goes away (i.e. test works fine) if I compile the code with -O1
> instead of -O3, or if I use GCC v8.5 instead. I'll try to find out more, but
> as a temporary workaround, we could also switch to -O1 instead of -O3.
I noticed that the problem does not occur when running the test natively
on my s390x box, or via qemu-s390x on my x86 laptop, or when running it
via qemu-s390x v6.1.0 on my s390x box. So it's something wrong in the TCG
backend, I think, and I was able to bisect the issue down to this commit
here:
$ git bisect bad
9bca986df88b8ea46b100e3d21cc9e653c83e0b3 is the first bad commit
commit 9bca986df88b8ea46b100e3d21cc9e653c83e0b3
Author: Richard Henderson <richard.henderson@linaro.org>
Date: Mon Sep 14 20:36:36 2020 -0700
tcg/s390x: Implement TCG_TARGET_HAS_bitsel_vec
Richard, could you please have a look? I've uploaded my statically linked
binary that shows the problem here:
http://people.redhat.com/~thuth/data/sha512
When running on a z15 s390x host with current QEMU master, the test fails:
$ ./qemu-s390x -cpu max ~/sha512
qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
qemu-s390x: warning: 'msa5-base' requires 'klmd-sha-512'.
1..1
h : 0000: 38 31 a6 a6 15 5e 50 9d ee 59 a7 f4 51 eb 35 32 81...^P..Y..Q.52
h : 0010: 4d 8f 8f 2d f6 e3 70 88 94 74 0f 98 fd ee 23 88 M..-..p..t....#.
h : 0020: 9f 4d e5 ad b0 c5 01 0d fb 55 5c da 77 c8 ab 5d .M.......U\.w..]
h : 0030: c9 02 09 4c 52 de 32 78 f3 5a 75 eb c2 5f 09 3a ...LR.2x.Zu.._.:
got : 0000: 7b 47 7b 48 1a 49 1a 49 79 48 7d 7f 7d 47 79 7d {G{H.I.IyH}.}Gy}
got : 0010: 1a 7f 7d 40 1a 48 19 4b 7d 48 1a 7b 7b 48 7b 49 ..}@.H.K}H.{{H{I
got : 0020: 7f 7d 7f 7f 7f 7f 7b 7d 19 49 1a 48 7f 47 7f 47 .}....{}.I.H.G.G
got : 0030: 79 4b 7f 4b 77 7f 79 47 19 7d 1a 7f 7b 48 7f 47 yK.Kw.yG.}..{H.G
got : 0040: 79 7f 7f 7d 1a 48 1a 7d 19 47 1c 48 77 48 77 7d y..}.H.}.G.HwHw}
got : 0050: 19 7b 7d 48 7d 7f 19 7b 7f 48 1c 47 1a 7b 7d 7d .{}H}..{.H.G.{}}
got : 0060: 1c 40 77 49 77 40 7f 7f 7d 49 19 7f 7b 49 7f 47 .@wIw@..}I..{I.G
got : 0070: 19 48 7d 7b 7f 48 1a 7b 1c 49 7d 7f 77 40 7b 7b .H}{.H.{.I}.w@{{
got : 0080: 00 .
not ok 1 - do_test(&tests[0])
# Failed test (sha512.c:main() at line 1046)
# Looks like you failed 1 tests of 1.
When running on my x86 laptop, the test succeeds:
$ ./qemu-s390x -cpu max ~/sha512
qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
qemu-s390x: warning: 'msa5-base' requires 'klmd-sha-512'.
1..1
h : 0000: 38 31 a6 a6 15 5e 50 9d ee 59 a7 f4 51 eb 35 32 81...^P..Y..Q.52
h : 0010: 4d 8f 8f 2d f6 e3 70 88 94 74 0f 98 fd ee 23 88 M..-..p..t....#.
h : 0020: 9f 4d e5 ad b0 c5 01 0d fb 55 5c da 77 c8 ab 5d .M.......U\.w..]
h : 0030: c9 02 09 4c 52 de 32 78 f3 5a 75 eb c2 5f 09 3a ...LR.2x.Zu.._.:
got : 0000: 33 38 33 31 61 36 61 36 31 35 35 65 35 30 39 64 3831a6a6155e509d
got : 0010: 65 65 35 39 61 37 66 34 35 31 65 62 33 35 33 32 ee59a7f451eb3532
got : 0020: 34 64 38 66 38 66 32 64 66 36 65 33 37 30 38 38 4d8f8f2df6e37088
got : 0030: 39 34 37 34 30 66 39 38 66 64 65 65 32 33 38 38 94740f98fdee2388
got : 0040: 39 66 34 64 65 35 61 64 62 30 63 35 30 31 30 64 9f4de5adb0c5010d
got : 0050: 66 62 35 35 35 63 64 61 37 37 63 38 61 62 35 64 fb555cda77c8ab5d
got : 0060: 63 39 30 32 30 39 34 63 35 32 64 65 33 32 37 38 c902094c52de3278
got : 0070: 66 33 35 61 37 35 65 62 63 32 35 66 30 39 33 61 f35a75ebc25f093a
got : 0080: 00 .
ok 1 - do_test(&tests[0])
BTW, we recently also saw some issues with the migration qtest on a s390x
host, maybe that's related:
https://app.travis-ci.com/gitlab/qemu-project/qemu/jobs/562674331#L7834
https://app.travis-ci.com/github/huth/qemu/jobs/562290832#L7783
?
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-10 8:36 ` Thomas Huth
2022-03-10 10:21 ` Thomas Huth
@ 2022-03-10 10:34 ` Alex Bennée
2022-03-10 10:41 ` Thomas Huth
1 sibling, 1 reply; 10+ messages in thread
From: Alex Bennée @ 2022-03-10 10:34 UTC (permalink / raw)
To: Thomas Huth
Cc: open list:S390 TCG CPUs, Cornelia Huck, Richard Henderson,
qemu-devel, David Hildenbrand
Thomas Huth <thuth@redhat.com> writes:
> On 09/03/2022 12.22, Alex Bennée wrote:
>> With -cpu max we get a warning:
>> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>> But dropping the -cpu max and it still runs fine.
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Cc: Thomas Huth <thuth@redhat.com>
>> ---
>> tests/tcg/s390x/Makefile.target | 2 --
>> 1 file changed, 2 deletions(-)
>> diff --git a/tests/tcg/s390x/Makefile.target
>> b/tests/tcg/s390x/Makefile.target
>> index 257c568c58..7aa502a557 100644
>> --- a/tests/tcg/s390x/Makefile.target
>> +++ b/tests/tcg/s390x/Makefile.target
>> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
>> sha512-mvx: sha512.c
>> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>> -run-sha512-mvx: QEMU_OPTS+=-cpu max
>> -
>> TESTS+=sha512-mvx
>
> Ok, this helps to get rid of the warnings, thus feel free to add:
>
> Tested-by: Thomas Huth <thuth@redhat.com>
>
> However, the error still persists. I now had a closer look by running
> the test with "qemu-s390x" on my z15 machine directly, and all tests
> are failing! The problem happens with both, gcc v11.2.1 and clang
> v13.0.1. The problem goes away (i.e. test works fine) if I compile the
> code with -O1 instead of -O3, or if I use GCC v8.5 instead. I'll try
> to find out more, but as a temporary workaround, we could also switch
> to -O1 instead of -O3.
The -O3 is included to force the compiler to vectorise the code -
otherwise you will get the same code as the plain sha512 test. However
is it because gcc v11.2.1 is using even more advanced mvx instructions
or just getting it's code generation wrong?
Do the tests also fail when run natively?
>
> Thomas
--
Alex Bennée
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-10 10:34 ` Alex Bennée
@ 2022-03-10 10:41 ` Thomas Huth
2022-03-10 11:33 ` Alex Bennée
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Huth @ 2022-03-10 10:41 UTC (permalink / raw)
To: Alex Bennée
Cc: open list:S390 TCG CPUs, Cornelia Huck, Richard Henderson,
qemu-devel, David Hildenbrand
On 10/03/2022 11.34, Alex Bennée wrote:
>
> Thomas Huth <thuth@redhat.com> writes:
>
>> On 09/03/2022 12.22, Alex Bennée wrote:
>>> With -cpu max we get a warning:
>>> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>>> But dropping the -cpu max and it still runs fine.
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> Cc: Thomas Huth <thuth@redhat.com>
>>> ---
>>> tests/tcg/s390x/Makefile.target | 2 --
>>> 1 file changed, 2 deletions(-)
>>> diff --git a/tests/tcg/s390x/Makefile.target
>>> b/tests/tcg/s390x/Makefile.target
>>> index 257c568c58..7aa502a557 100644
>>> --- a/tests/tcg/s390x/Makefile.target
>>> +++ b/tests/tcg/s390x/Makefile.target
>>> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
>>> sha512-mvx: sha512.c
>>> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>>> -run-sha512-mvx: QEMU_OPTS+=-cpu max
>>> -
>>> TESTS+=sha512-mvx
>>
>> Ok, this helps to get rid of the warnings, thus feel free to add:
>>
>> Tested-by: Thomas Huth <thuth@redhat.com>
>>
>> However, the error still persists. I now had a closer look by running
>> the test with "qemu-s390x" on my z15 machine directly, and all tests
>> are failing! The problem happens with both, gcc v11.2.1 and clang
>> v13.0.1. The problem goes away (i.e. test works fine) if I compile the
>> code with -O1 instead of -O3, or if I use GCC v8.5 instead. I'll try
>> to find out more, but as a temporary workaround, we could also switch
>> to -O1 instead of -O3.
>
> The -O3 is included to force the compiler to vectorise the code -
> otherwise you will get the same code as the plain sha512 test. However
> is it because gcc v11.2.1 is using even more advanced mvx instructions
> or just getting it's code generation wrong?
>
> Do the tests also fail when run natively?
No, it's running fine natively (see my other mail), it must be something in
the s390x TCG backend.
It's definitely related to commit 9bca986df88b8ea ... I just tried to switch
TCG_TARGET_HAS_bitsel_vec back to 0, and then the test is working fine again...
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-10 10:41 ` Thomas Huth
@ 2022-03-10 11:33 ` Alex Bennée
0 siblings, 0 replies; 10+ messages in thread
From: Alex Bennée @ 2022-03-10 11:33 UTC (permalink / raw)
To: Thomas Huth
Cc: open list:S390 TCG CPUs, Cornelia Huck, Richard Henderson,
qemu-devel, David Hildenbrand
Thomas Huth <thuth@redhat.com> writes:
> On 10/03/2022 11.34, Alex Bennée wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>>
>>> On 09/03/2022 12.22, Alex Bennée wrote:
>>>> With -cpu max we get a warning:
>>>> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>>>> But dropping the -cpu max and it still runs fine.
>>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>>> Cc: Thomas Huth <thuth@redhat.com>
>>>> ---
>>>> tests/tcg/s390x/Makefile.target | 2 --
>>>> 1 file changed, 2 deletions(-)
>>>> diff --git a/tests/tcg/s390x/Makefile.target
>>>> b/tests/tcg/s390x/Makefile.target
>>>> index 257c568c58..7aa502a557 100644
>>>> --- a/tests/tcg/s390x/Makefile.target
>>>> +++ b/tests/tcg/s390x/Makefile.target
>>>> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
>>>> sha512-mvx: sha512.c
>>>> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>>>> -run-sha512-mvx: QEMU_OPTS+=-cpu max
>>>> -
>>>> TESTS+=sha512-mvx
>>>
>>> Ok, this helps to get rid of the warnings, thus feel free to add:
>>>
>>> Tested-by: Thomas Huth <thuth@redhat.com>
>>>
>>> However, the error still persists. I now had a closer look by running
>>> the test with "qemu-s390x" on my z15 machine directly, and all tests
>>> are failing! The problem happens with both, gcc v11.2.1 and clang
>>> v13.0.1. The problem goes away (i.e. test works fine) if I compile the
>>> code with -O1 instead of -O3, or if I use GCC v8.5 instead. I'll try
>>> to find out more, but as a temporary workaround, we could also switch
>>> to -O1 instead of -O3.
>> The -O3 is included to force the compiler to vectorise the code -
>> otherwise you will get the same code as the plain sha512 test. However
>> is it because gcc v11.2.1 is using even more advanced mvx instructions
>> or just getting it's code generation wrong?
>> Do the tests also fail when run natively?
>
> No, it's running fine natively (see my other mail), it must be
> something in the s390x TCG backend.
>
> It's definitely related to commit 9bca986df88b8ea ... I just tried to
> switch TCG_TARGET_HAS_bitsel_vec back to 0, and then the test is
> working fine again...
Yeah it doesn't trigger on the s390x I've got so I guess the newer
compilers generates something we've not seen before and that trips up on
the new vector bitsel generation.
At least the test is doing it's job of exercising more of the vector
code generation.
>
> Thomas
--
Alex Bennée
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-10 10:21 ` Thomas Huth
@ 2022-03-10 11:35 ` Richard Henderson
2022-03-10 12:28 ` Thomas Huth
0 siblings, 1 reply; 10+ messages in thread
From: Richard Henderson @ 2022-03-10 11:35 UTC (permalink / raw)
To: Thomas Huth, Alex Bennée, qemu-devel
Cc: open list:S390 TCG CPUs, Cornelia Huck, Dr. David Alan Gilbert,
David Hildenbrand
On 3/10/22 02:21, Thomas Huth wrote:
> On 10/03/2022 09.36, Thomas Huth wrote:
>> On 09/03/2022 12.22, Alex Bennée wrote:
>>> With -cpu max we get a warning:
>>>
>>> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
>>>
>>> But dropping the -cpu max and it still runs fine.
>>>
>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>> Cc: Thomas Huth <thuth@redhat.com>
>>> ---
>>> tests/tcg/s390x/Makefile.target | 2 --
>>> 1 file changed, 2 deletions(-)
>>>
>>> diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
>>> index 257c568c58..7aa502a557 100644
>>> --- a/tests/tcg/s390x/Makefile.target
>>> +++ b/tests/tcg/s390x/Makefile.target
>>> @@ -34,6 +34,4 @@ sha512-mvx: CFLAGS=-march=z13 -mvx -O3
>>> sha512-mvx: sha512.c
>>> $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
>>> -run-sha512-mvx: QEMU_OPTS+=-cpu max
>>> -
>>> TESTS+=sha512-mvx
>>
>> Ok, this helps to get rid of the warnings, thus feel free to add:
>>
>> Tested-by: Thomas Huth <thuth@redhat.com>
>>
>> However, the error still persists. I now had a closer look by running the test with
>> "qemu-s390x" on my z15 machine directly, and all tests are failing! The problem happens
>> with both, gcc v11.2.1 and clang v13.0.1. The problem goes away (i.e. test works fine)
>> if I compile the code with -O1 instead of -O3, or if I use GCC v8.5 instead. I'll try to
>> find out more, but as a temporary workaround, we could also switch to -O1 instead of -O3.
>
> I noticed that the problem does not occur when running the test natively
> on my s390x box, or via qemu-s390x on my x86 laptop, or when running it
> via qemu-s390x v6.1.0 on my s390x box. So it's something wrong in the TCG
> backend, I think, and I was able to bisect the issue down to this commit
> here:
>
> $ git bisect bad
> 9bca986df88b8ea46b100e3d21cc9e653c83e0b3 is the first bad commit
> commit 9bca986df88b8ea46b100e3d21cc9e653c83e0b3
> Author: Richard Henderson <richard.henderson@linaro.org>
> Date: Mon Sep 14 20:36:36 2020 -0700
>
> tcg/s390x: Implement TCG_TARGET_HAS_bitsel_vec
>
> Richard, could you please have a look? I've uploaded my statically linked
> binary that shows the problem here:
>
> http://people.redhat.com/~thuth/data/sha512
>
> When running on a z15 s390x host with current QEMU master, the test fails:
>
> $ ./qemu-s390x -cpu max ~/sha512
> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
> qemu-s390x: warning: 'msa5-base' requires 'klmd-sha-512'.
> 1..1
> h : 0000: 38 31 a6 a6 15 5e 50 9d ee 59 a7 f4 51 eb 35 32 81...^P..Y..Q.52
> h : 0010: 4d 8f 8f 2d f6 e3 70 88 94 74 0f 98 fd ee 23 88 M..-..p..t....#.
> h : 0020: 9f 4d e5 ad b0 c5 01 0d fb 55 5c da 77 c8 ab 5d .M.......U\.w..]
> h : 0030: c9 02 09 4c 52 de 32 78 f3 5a 75 eb c2 5f 09 3a ...LR.2x.Zu.._.:
> got : 0000: 7b 47 7b 48 1a 49 1a 49 79 48 7d 7f 7d 47 79 7d {G{H.I.IyH}.}Gy}
> got : 0010: 1a 7f 7d 40 1a 48 19 4b 7d 48 1a 7b 7b 48 7b 49 ..}@.H.K}H.{{H{I
> got : 0020: 7f 7d 7f 7f 7f 7f 7b 7d 19 49 1a 48 7f 47 7f 47 .}....{}.I.H.G.G
> got : 0030: 79 4b 7f 4b 77 7f 79 47 19 7d 1a 7f 7b 48 7f 47 yK.Kw.yG.}..{H.G
> got : 0040: 79 7f 7f 7d 1a 48 1a 7d 19 47 1c 48 77 48 77 7d y..}.H.}.G.HwHw}
> got : 0050: 19 7b 7d 48 7d 7f 19 7b 7f 48 1c 47 1a 7b 7d 7d .{}H}..{.H.G.{}}
> got : 0060: 1c 40 77 49 77 40 7f 7f 7d 49 19 7f 7b 49 7f 47 .@wIw@..}I..{I.G
> got : 0070: 19 48 7d 7b 7f 48 1a 7b 1c 49 7d 7f 77 40 7b 7b .H}{.H.{.I}.w@{{
> got : 0080: 00 .
> not ok 1 - do_test(&tests[0])
> # Failed test (sha512.c:main() at line 1046)
> # Looks like you failed 1 tests of 1.
>
> When running on my x86 laptop, the test succeeds:
>
> $ ./qemu-s390x -cpu max ~/sha512
> qemu-s390x: warning: 'msa5-base' requires 'kimd-sha-512'.
> qemu-s390x: warning: 'msa5-base' requires 'klmd-sha-512'.
> 1..1
> h : 0000: 38 31 a6 a6 15 5e 50 9d ee 59 a7 f4 51 eb 35 32 81...^P..Y..Q.52
> h : 0010: 4d 8f 8f 2d f6 e3 70 88 94 74 0f 98 fd ee 23 88 M..-..p..t....#.
> h : 0020: 9f 4d e5 ad b0 c5 01 0d fb 55 5c da 77 c8 ab 5d .M.......U\.w..]
> h : 0030: c9 02 09 4c 52 de 32 78 f3 5a 75 eb c2 5f 09 3a ...LR.2x.Zu.._.:
> got : 0000: 33 38 33 31 61 36 61 36 31 35 35 65 35 30 39 64 3831a6a6155e509d
> got : 0010: 65 65 35 39 61 37 66 34 35 31 65 62 33 35 33 32 ee59a7f451eb3532
> got : 0020: 34 64 38 66 38 66 32 64 66 36 65 33 37 30 38 38 4d8f8f2df6e37088
> got : 0030: 39 34 37 34 30 66 39 38 66 64 65 65 32 33 38 38 94740f98fdee2388
> got : 0040: 39 66 34 64 65 35 61 64 62 30 63 35 30 31 30 64 9f4de5adb0c5010d
> got : 0050: 66 62 35 35 35 63 64 61 37 37 63 38 61 62 35 64 fb555cda77c8ab5d
> got : 0060: 63 39 30 32 30 39 34 63 35 32 64 65 33 32 37 38 c902094c52de3278
> got : 0070: 66 33 35 61 37 35 65 62 63 32 35 66 30 39 33 61 f35a75ebc25f093a
> got : 0080: 00 .
> ok 1 - do_test(&tests[0])
>
> BTW, we recently also saw some issues with the migration qtest on a s390x
> host, maybe that's related:
>
> https://app.travis-ci.com/gitlab/qemu-project/qemu/jobs/562674331#L7834
> https://app.travis-ci.com/github/huth/qemu/jobs/562290832#L7783
>
> ?
Ok, will look soon.
Would you pop this into an issue so I don't forget, please?
r~
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
2022-03-10 11:35 ` Richard Henderson
@ 2022-03-10 12:28 ` Thomas Huth
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Huth @ 2022-03-10 12:28 UTC (permalink / raw)
To: Richard Henderson, Alex Bennée, qemu-devel
Cc: open list:S390 TCG CPUs, Cornelia Huck, Dr. David Alan Gilbert,
David Hildenbrand
On 10/03/2022 12.35, Richard Henderson wrote:
> On 3/10/22 02:21, Thomas Huth wrote:
>> On 10/03/2022 09.36, Thomas Huth wrote:
[...]
>>> However, the error still persists. I now had a closer look by running the
>>> test with "qemu-s390x" on my z15 machine directly, and all tests are
>>> failing! The problem happens with both, gcc v11.2.1 and clang v13.0.1.
>>> The problem goes away (i.e. test works fine) if I compile the code with
>>> -O1 instead of -O3, or if I use GCC v8.5 instead. I'll try to find out
>>> more, but as a temporary workaround, we could also switch to -O1 instead
>>> of -O3.
>>
>> I noticed that the problem does not occur when running the test natively
>> on my s390x box, or via qemu-s390x on my x86 laptop, or when running it
>> via qemu-s390x v6.1.0 on my s390x box. So it's something wrong in the TCG
>> backend, I think, and I was able to bisect the issue down to this commit
>> here:
>>
>> $ git bisect bad
>> 9bca986df88b8ea46b100e3d21cc9e653c83e0b3 is the first bad commit
>> commit 9bca986df88b8ea46b100e3d21cc9e653c83e0b3
>> Author: Richard Henderson <richard.henderson@linaro.org>
>> Date: Mon Sep 14 20:36:36 2020 -0700
>>
>> tcg/s390x: Implement TCG_TARGET_HAS_bitsel_vec
>>
>> Richard, could you please have a look?
[...]> Ok, will look soon.
> Would you pop this into an issue so I don't forget, please?
Sure, I've created a ticket here:
https://gitlab.com/qemu-project/qemu/-/issues/898
Thomas
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-03-10 12:55 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 11:22 [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation Alex Bennée
2022-03-09 11:23 ` David Hildenbrand
2022-03-09 20:44 ` Richard Henderson
2022-03-10 8:36 ` Thomas Huth
2022-03-10 10:21 ` Thomas Huth
2022-03-10 11:35 ` Richard Henderson
2022-03-10 12:28 ` Thomas Huth
2022-03-10 10:34 ` Alex Bennée
2022-03-10 10:41 ` Thomas Huth
2022-03-10 11:33 ` Alex Bennée
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).