[Qemu-devel] [PATCH v1 0/2] s390x/tcg: STFLE fixes

David Hildenbrand posted 2 patches 6 years, 5 months ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190531145608.28183-1-david@redhat.com
Maintainers: David Hildenbrand <david@redhat.com>, Richard Henderson <rth@twiddle.net>, Cornelia Huck <cohuck@redhat.com>
target/s390x/misc_helper.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH v1 0/2] s390x/tcg: STFLE fixes
Posted by David Hildenbrand 6 years, 5 months ago
While testing vector instructions, I ran into various issues with
user space binaries compiled with more recent compiler versions like

# gunzip /usr/share/man/man1/hexdump.1.gz
<dhildenb> *** stack smashing detected ***: <unknown> terminated

Turns out:
a) the STFLE instruction in semi-broken on the first invocation
b) the code expects a different STFLE behavior than documented in the PoP

Fix a) and make sure the code works by adjusting b).

David Hildenbrand (2):
  s390x/tcg: Fix max_byte detection for stfle
  s390x/tcg: Store only the necessary amount of doublewords for STFLE

 target/s390x/misc_helper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.20.1


Re: [Qemu-devel] [PATCH v1 0/2] s390x/tcg: STFLE fixes
Posted by Cornelia Huck 6 years, 5 months ago
On Fri, 31 May 2019 16:56:06 +0200
David Hildenbrand <david@redhat.com> wrote:

> While testing vector instructions, I ran into various issues with
> user space binaries compiled with more recent compiler versions like
> 
> # gunzip /usr/share/man/man1/hexdump.1.gz
> <dhildenb> *** stack smashing detected ***: <unknown> terminated
> 
> Turns out:
> a) the STFLE instruction in semi-broken on the first invocation
> b) the code expects a different STFLE behavior than documented in the PoP
> 
> Fix a) and make sure the code works by adjusting b).
> 

So your problems actually did not have anything to do with vector
instructions and were simply exposed by running binaries compiled with a
more recent compiler version, right? Interesting :)

> David Hildenbrand (2):
>   s390x/tcg: Fix max_byte detection for stfle
>   s390x/tcg: Store only the necessary amount of doublewords for STFLE
> 
>  target/s390x/misc_helper.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Do you want to include these in a pull request, or should I pick them
up myself?

Re: [Qemu-devel] [PATCH v1 0/2] s390x/tcg: STFLE fixes
Posted by David Hildenbrand 6 years, 5 months ago
On 03.06.19 09:02, Cornelia Huck wrote:
> On Fri, 31 May 2019 16:56:06 +0200
> David Hildenbrand <david@redhat.com> wrote:
> 
>> While testing vector instructions, I ran into various issues with
>> user space binaries compiled with more recent compiler versions like
>>
>> # gunzip /usr/share/man/man1/hexdump.1.gz
>> <dhildenb> *** stack smashing detected ***: <unknown> terminated
>>
>> Turns out:
>> a) the STFLE instruction in semi-broken on the first invocation
>> b) the code expects a different STFLE behavior than documented in the PoP
>>
>> Fix a) and make sure the code works by adjusting b).
>>
> 
> So your problems actually did not have anything to do with vector
> instructions and were simply exposed by running binaries compiled with a
> more recent compiler version, right? Interesting :)

Yes, but it's not the complete story yet. There are still two BUGs
somewhere in emulation code (again, could be !vector register related).
These seem to be harder to track down (e.g., rpm database corruptions
when installing a lot of packages at once).

> 
>> David Hildenbrand (2):
>>   s390x/tcg: Fix max_byte detection for stfle
>>   s390x/tcg: Store only the necessary amount of doublewords for STFLE
>>
>>  target/s390x/misc_helper.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
> 
> Do you want to include these in a pull request, or should I pick them
> up myself?
> 

I can include them.

-- 

Thanks,

David / dhildenb