qemu-s390x
[Top][All Lists]
Advanced

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

Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocatio


From: Alex Bennée
Subject: Re: [RFC PATCH] tests/tcg: drop -cpu max from s390x sha512-mvx invocation
Date: Thu, 10 Mar 2022 11:33:37 +0000
User-agent: mu4e 1.7.9; emacs 28.0.91

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



reply via email to

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