From nobody Sat May 4 05:42:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494318593218126.9296600317673; Tue, 9 May 2017 01:29:53 -0700 (PDT) Received: from localhost ([::1]:35750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d80Wl-00044c-Sy for importer@patchew.org; Tue, 09 May 2017 04:29:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d80V7-0002hc-Lc for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d80V6-00005v-R9 for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:09 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:35422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d80V6-00005a-KW for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:08 -0400 Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1d80V5-0003hd-1u; Tue, 09 May 2017 10:28:07 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.89) (envelope-from ) id 1d80V4-0002oU-Kh; Tue, 09 May 2017 10:28:06 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 9 May 2017 10:27:58 +0200 Message-Id: <20170509082800.10756-2-aurelien@aurel32.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170509082800.10756-1-aurelien@aurel32.net> References: <20170509082800.10756-1-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH 1/3] target/s390x: mask the SIGP order_code using SIGP_ORDER_MASK X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , Christian Borntraeger , Alexander Graf , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For that move the definition from kvm.c to cpu.h Signed-off-by: Aurelien Jarno Reviewed-by: Cornelia Huck Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth --- target/s390x/cpu.h | 3 +++ target/s390x/kvm.c | 2 -- target/s390x/misc_helper.c | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index df823280a5..2471db920d 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -1081,6 +1081,9 @@ struct sysib_322 { #define SIGP_MODE_Z_ARCH_TRANS_ALL_PSW 1 #define SIGP_MODE_Z_ARCH_TRANS_CUR_PSW 2 =20 +/* SIGP order code mask corresponding to bit positions 56-63 */ +#define SIGP_ORDER_MASK 0x000000ff + void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr); int mmu_translate(CPUS390XState *env, target_ulong vaddr, int rw, uint64_t= asc, target_ulong *raddr, int *flags, bool exc); diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 1a249d8359..fb105429be 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1764,8 +1764,6 @@ static int sigp_set_architecture(S390CPU *cpu, uint32= _t param, return SIGP_CC_ORDER_CODE_ACCEPTED; } =20 -#define SIGP_ORDER_MASK 0x000000ff - static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) { CPUS390XState *env =3D &cpu->env; diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index 53cb3b8ac6..395f38dea5 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -521,8 +521,7 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t orde= r_code, uint32_t r1, =20 qemu_mutex_lock_iothread(); =20 - /* sigp contains the order code in bit positions 56-63, mask it here. = */ - switch (order_code & 0xff) { + switch (order_code & SIGP_ORDER_MASK) { case SIGP_SET_ARCH: cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; /* switch arch */ --=20 2.11.0 From nobody Sat May 4 05:42:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494318727267414.31276522050575; Tue, 9 May 2017 01:32:07 -0700 (PDT) Received: from localhost ([::1]:35764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d80Yv-00060Q-Rf for importer@patchew.org; Tue, 09 May 2017 04:32:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d80V7-0002ha-L5 for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d80V6-00005q-R1 for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:09 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:35426) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d80V6-00005c-L1 for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:08 -0400 Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1d80V5-0003hh-Ip; Tue, 09 May 2017 10:28:07 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.89) (envelope-from ) id 1d80V5-0002ob-6r; Tue, 09 May 2017 10:28:07 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 9 May 2017 10:27:59 +0200 Message-Id: <20170509082800.10756-3-aurelien@aurel32.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170509082800.10756-1-aurelien@aurel32.net> References: <20170509082800.10756-1-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH 2/3] target/s390x: fix SIGNAL PROCESSOR return value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The SIGNAL PROCESSOR helper returns its value through the CC register. set_cc_static should be called just after the helper. Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson --- target/s390x/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 558ff78084..c58c27f8e9 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -3363,6 +3363,7 @@ static ExitStatus op_sigp(DisasContext *s, DisasOps *= o) check_privileged(s); potential_page_fault(s); gen_helper_sigp(cc_op, cpu_env, o->in2, r1, o->in1); + set_cc_static(s); tcg_temp_free_i32(r1); return NO_EXIT; } --=20 2.11.0 From nobody Sat May 4 05:42:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494318856067713.4403142837708; Tue, 9 May 2017 01:34:16 -0700 (PDT) Received: from localhost ([::1]:35778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d80b0-0007mi-L7 for importer@patchew.org; Tue, 09 May 2017 04:34:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d80V7-0002hg-OQ for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d80V7-000063-0t for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:09 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:35430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d80V6-00005g-Rn for qemu-devel@nongnu.org; Tue, 09 May 2017 04:28:08 -0400 Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1d80V5-0003hk-Ve; Tue, 09 May 2017 10:28:07 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.89) (envelope-from ) id 1d80V5-0002oi-JT; Tue, 09 May 2017 10:28:07 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 9 May 2017 10:28:00 +0200 Message-Id: <20170509082800.10756-4-aurelien@aurel32.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170509082800.10756-1-aurelien@aurel32.net> References: <20170509082800.10756-1-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH 3/3] target/s390x: implement serialization in BRANCH CONDITION X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Graf , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Aurelien Jarno Reviewed-by: Richard Henderson --- target/s390x/translate.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/s390x/translate.c b/target/s390x/translate.c index c58c27f8e9..2f07ce2be9 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -1517,6 +1517,21 @@ static ExitStatus op_bc(DisasContext *s, DisasOps *o) int imm =3D is_imm ? get_field(s->fields, i2) : 0; DisasCompare c; =20 + /* BCR with R2 =3D 0 causes no branching */ + if (have_field(s->fields, r2) && get_field(s->fields, r2) =3D=3D 0) { + if (m1 =3D=3D 14) { + /* Perform serialization */ + /* FIXME: check for fast-BCR-serialization facility */ + tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC); + } + if (m1 =3D=3D 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); } --=20 2.11.0