]> git.proxmox.com Git - mirror_qemu.git/commit
target/s390x: Fix the "ignored match" case in VSTRS
authorIlya Leoshkevich <iii@linux.ibm.com>
Fri, 4 Aug 2023 23:03:18 +0000 (01:03 +0200)
committerThomas Huth <thuth@redhat.com>
Wed, 23 Aug 2023 10:06:52 +0000 (12:06 +0200)
commit791b2b6a930273db694b9ba48bbb406e78715927
treefaa574bbd1fa9e6c49f053899c8792a9d1d302e3
parentffc8453bd25ac62ad89e26974a8107846d2f1390
target/s390x: Fix the "ignored match" case in VSTRS

Currently the emulation of VSTRS recognizes partial matches in presence
of \0 in the haystack, which, according to PoP, is not correct:

    If the ZS flag is one and a zero byte was detected
    in the second operand, then there can not be a
    partial match ...

Add a check for this. While at it, fold a number of explicitly handled
special cases into the generic logic.

Cc: qemu-stable@nongnu.org
Reported-by: Claudio Fontana <cfontana@suse.de>
Closes: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg00633.html
Fixes: 1d706f314191 ("target/s390x: vxeh2: vector string search")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230804233748.218935-3-iii@linux.ibm.com>
Tested-by: Claudio Fontana <cfontana@suse.de>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/tcg/vec_string_helper.c