qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PULL 9/9] target/s390x: implement serialization in BRANCH CONDITION
Date: Fri, 12 May 2017 16:40:09 -0700	[thread overview]
Message-ID: <20170512234009.32557-10-rth@twiddle.net> (raw)
In-Reply-To: <20170512234009.32557-1-rth@twiddle.net>

From: Aurelien Jarno <aurelien@aurel32.net>

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Message-Id: <20170509082800.10756-4-aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/s390x/translate.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index 3a0a3ee..4c48c59 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -1518,6 +1518,21 @@ static ExitStatus op_bc(DisasContext *s, DisasOps *o)
     int imm = is_imm ? get_field(s->fields, i2) : 0;
     DisasCompare c;
 
+    /* BCR with R2 = 0 causes no branching */
+    if (have_field(s->fields, r2) && get_field(s->fields, r2) == 0) {
+        if (m1 == 14) {
+            /* Perform serialization */
+            /* FIXME: check for fast-BCR-serialization facility */
+            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
+        }
+        if (m1 == 15) {
+            /* Perform serialization */
+            /* FIXME: perform checkpoint-synchronisation */
+            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
+        }
+        return NO_EXIT;
+    }
+
     disas_jcc(s, &c, m1);
     return help_branch(s, &c, is_imm, imm, o->in2);
 }
-- 
2.9.3

  parent reply	other threads:[~2017-05-12 23:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 23:40 [Qemu-devel] [PULL 0/9] Queued s390 patches Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 1/9] target/s390x: Implement STORE FACILITIES LIST EXTENDED Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 2/9] target/s390x: Implement LOAD PROGRAM PARAMETER Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 3/9] target/s390x: Diagnose specification exception for atomics Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 4/9] target/s390x: Implement LOAD PAIR DISJOINT Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 5/9] target/s390x: Use atomic operations for COMPARE SWAP Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 6/9] target/s390x: Use atomic operations for LOAD AND OP Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 7/9] target/s390x: mask the SIGP order_code using SIGP_ORDER_MASK Richard Henderson
2017-05-12 23:40 ` [Qemu-devel] [PULL 8/9] target/s390x: fix SIGNAL PROCESSOR return value Richard Henderson
2017-05-12 23:40 ` Richard Henderson [this message]
2017-05-15 14:11 ` [Qemu-devel] [PULL 0/9] Queued s390 patches Stefan Hajnoczi

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=20170512234009.32557-10-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).