From: David Hildenbrand <david@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
David Hildenbrand <david@redhat.com>,
Thomas Huth <thuth@redhat.com>,
Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PATCH v1 1/2] s390x/tcg: Fix max_byte detection for stfle
Date: Fri, 31 May 2019 16:56:07 +0200 [thread overview]
Message-ID: <20190531145608.28183-2-david@redhat.com> (raw)
In-Reply-To: <20190531145608.28183-1-david@redhat.com>
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().
Signed-off-by: David Hildenbrand <david@redhat.com>
---
target/s390x/misc_helper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
}
--
2.20.1
next prev parent reply other threads:[~2019-05-31 15:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 14:56 [Qemu-devel] [PATCH v1 0/2] s390x/tcg: STFLE fixes David Hildenbrand
2019-05-31 14:56 ` David Hildenbrand [this message]
2019-05-31 15:02 ` [Qemu-devel] [PATCH v1 1/2] s390x/tcg: Fix max_byte detection for stfle Richard Henderson
2019-05-31 14:56 ` [Qemu-devel] [PATCH v1 2/2] s390x/tcg: Store only the necessary amount of doublewords for STFLE David Hildenbrand
2019-05-31 15:05 ` Richard Henderson
2019-05-31 15:08 ` David Hildenbrand
2019-06-03 10:38 ` Stefan Liebler
2019-06-03 10:45 ` David Hildenbrand
2019-06-03 14:39 ` Stefan Liebler
2019-06-04 8:11 ` David Hildenbrand
2019-06-03 7:02 ` [Qemu-devel] [PATCH v1 0/2] s390x/tcg: STFLE fixes Cornelia Huck
2019-06-03 7:16 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190531145608.28183-2-david@redhat.com \
--to=david@redhat.com \
--cc=cohuck@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).