Skip to content

Commit

Permalink
target/s390x: Fix VSTL with a large length
Browse files Browse the repository at this point in the history
The length is always truncated to 16 bytes. Do not probe more than
that.

Cc: qemu-stable@nongnu.org
Fixes: 0e0a5b4 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230804235624.263260-1-iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
(cherry picked from commit 6db3518)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
iii-i authored and Michael Tokarev committed Sep 10, 2023
1 parent 75bfe5c commit 8e8ba59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/s390x/tcg/vec_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void HELPER(vstl)(CPUS390XState *env, const void *v1, uint64_t addr,
uint64_t bytes)
{
/* Probe write access before actually modifying memory */
probe_write_access(env, addr, bytes, GETPC());
probe_write_access(env, addr, MIN(bytes, 16), GETPC());

if (likely(bytes >= 16)) {
cpu_stq_data_ra(env, addr, s390_vec_read_element64(v1, 0), GETPC());
Expand Down

0 comments on commit 8e8ba59

Please sign in to comment.