qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, cohuck@redhat.com, david@redhat.com,
	richard.henderson@linaro.org,
	Pavel Zbitskiy <pavel.zbitskiy@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	Alexander Graf <agraf@suse.de>
Subject: [Qemu-devel] [PATCH v5 2/3] target/s390x: exception on non-aligned LPSW(E)
Date: Sat,  1 Sep 2018 20:33:21 -0400	[thread overview]
Message-ID: <20180902003322.3428-3-pavel.zbitskiy@gmail.com> (raw)
In-Reply-To: <20180902003322.3428-1-pavel.zbitskiy@gmail.com>

Both LPSW and LPSWE should raise a specification exception when their
operand is not doubleword aligned.

Signed-off-by: Pavel Zbitskiy <pavel.zbitskiy@gmail.com>
---
 target/s390x/translate.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 7363aabf3a..59b1e5893c 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -2835,7 +2835,8 @@ static DisasJumpType op_lpsw(DisasContext *s, DisasOps *o)
 
     t1 = tcg_temp_new_i64();
     t2 = tcg_temp_new_i64();
-    tcg_gen_qemu_ld32u(t1, o->in2, get_mem_index(s));
+    tcg_gen_qemu_ld_i64(t1, o->in2, get_mem_index(s),
+                        MO_TEUL | MO_ALIGN_8);
     tcg_gen_addi_i64(o->in2, o->in2, 4);
     tcg_gen_qemu_ld32u(t2, o->in2, get_mem_index(s));
     /* Convert the 32-bit PSW_MASK into the 64-bit PSW_MASK.  */
@@ -2855,7 +2856,8 @@ static DisasJumpType op_lpswe(DisasContext *s, DisasOps *o)
 
     t1 = tcg_temp_new_i64();
     t2 = tcg_temp_new_i64();
-    tcg_gen_qemu_ld64(t1, o->in2, get_mem_index(s));
+    tcg_gen_qemu_ld_i64(t1, o->in2, get_mem_index(s),
+                        MO_TEQ | MO_ALIGN_8);
     tcg_gen_addi_i64(o->in2, o->in2, 8);
     tcg_gen_qemu_ld64(t2, o->in2, get_mem_index(s));
     gen_helper_load_psw(cpu_env, t1, t2);
-- 
2.18.0

  parent reply	other threads:[~2018-09-02  0:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-02  0:33 [Qemu-devel] [PATCH v5 0/3] Some improvements in z/Arch instructions support Pavel Zbitskiy
2018-09-02  0:33 ` [Qemu-devel] [PATCH v5 1/3] target/s390x: use regular spaces in translate.c Pavel Zbitskiy
2018-09-02  0:33 ` Pavel Zbitskiy [this message]
2018-10-02 11:06   ` [Qemu-devel] [PATCH v5 2/3] target/s390x: exception on non-aligned LPSW(E) Cornelia Huck
2018-09-02  0:33 ` [Qemu-devel] [PATCH v5 3/3] target/s390x: implement CVB, CVBY and CVBG Pavel Zbitskiy
2018-09-02 14:36 ` [Qemu-devel] [PATCH v5 0/3] Some improvements in z/Arch instructions support 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=20180902003322.3428-3-pavel.zbitskiy@gmail.com \
    --to=pavel.zbitskiy@gmail.com \
    --cc=agraf@suse.de \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    /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).