aboutsummaryrefslogtreecommitdiff
path: root/target/s390x
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2019-05-31 16:31:44 +0200
committerDavid Hildenbrand <david@redhat.com>2019-06-07 14:53:25 +0200
commit88a29e867528c57151103e64a966a9cbaeec852f (patch)
treeffc50c2d21bc3ee12aae7ba076e233f62f60bf83 /target/s390x
parent4f83d7d2121a8b4cce59c06f7d74c47cdedd79eb (diff)
s390x/tcg: Fix max_byte detection for stfle
used_stfl_bytes is 0, before initialized via prepare_stfl() on the first invocation. We have to move the calculation of max_bytes after prepare_stfl(). Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'target/s390x')
-rw-r--r--target/s390x/misc_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index ee67c1fa0c..34476134a4 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -669,7 +669,7 @@ uint32_t HELPER(stfle)(CPUS390XState *env, uint64_t addr)
{
const uintptr_t ra = GETPC();
const int count_bytes = ((env->regs[0] & 0xff) + 1) * 8;
- const int max_bytes = ROUND_UP(used_stfl_bytes, 8);
+ int max_bytes;
int i;
if (addr & 0x7) {
@@ -677,6 +677,7 @@ uint32_t HELPER(stfle)(CPUS390XState *env, uint64_t addr)
}
prepare_stfl();
+ max_bytes = ROUND_UP(used_stfl_bytes, 8);
for (i = 0; i < count_bytes; ++i) {
cpu_stb_data_ra(env, addr + i, stfl_bytes[i], ra);
}