From nobody Fri May 3 15:22:18 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523273562336908.3117552049623; Mon, 9 Apr 2018 04:32:42 -0700 (PDT) Received: from localhost ([::1]:58819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5V2N-0006Wm-HL for importer@patchew.org; Mon, 09 Apr 2018 07:32:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5V0N-0005FZ-LK for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:30:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5V0H-0007SO-T3 for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:30:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41920 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5V0H-0007Ry-OD; Mon, 09 Apr 2018 07:30:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 504AE406FA23; Mon, 9 Apr 2018 11:30:27 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-190.ams2.redhat.com [10.36.117.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC333215CDC8; Mon, 9 Apr 2018 11:30:25 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org Date: Mon, 9 Apr 2018 13:30:18 +0200 Message-Id: <20180409113019.14568-2-david@redhat.com> In-Reply-To: <20180409113019.14568-1-david@redhat.com> References: <20180409113019.14568-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 11:30:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 11:30:27 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v1 for-2.12 1/2] s390x/mmu: don't overwrite pending exception in mmu translate 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: Thomas Huth , David Hildenbrand , Cornelia Huck , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , 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" If we already triggered another exception, don't overwrite it with a protection exception. Signed-off-by: David Hildenbrand Acked-by: Christian Borntraeger Reviewed-by: Thomas Huth --- target/s390x/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 1deeb6e6e4..a25deef5dd 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -325,7 +325,7 @@ static int mmu_translate_asce(CPUS390XState *env, targe= t_ulong vaddr, =20 r =3D mmu_translate_region(env, vaddr, asc, asce, level, raddr, flags,= rw, exc); - if (rw =3D=3D MMU_DATA_STORE && !(*flags & PAGE_WRITE)) { + if (!r && rw =3D=3D MMU_DATA_STORE && !(*flags & PAGE_WRITE)) { trigger_prot_fault(env, vaddr, asc, rw, exc); return -1; } --=20 2.14.3 From nobody Fri May 3 15:22:18 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523273557740236.4317983613788; Mon, 9 Apr 2018 04:32:37 -0700 (PDT) Received: from localhost ([::1]:58818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5V2E-0006Od-VU for importer@patchew.org; Mon, 09 Apr 2018 07:32:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5V0L-0005ES-0t for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:30:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5V0H-0007SG-SB for qemu-devel@nongnu.org; Mon, 09 Apr 2018 07:30:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41922 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5V0H-0007Rx-NP; Mon, 09 Apr 2018 07:30:29 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2D494072450; Mon, 9 Apr 2018 11:30:28 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-190.ams2.redhat.com [10.36.117.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C4B92166BAE; Mon, 9 Apr 2018 11:30:27 +0000 (UTC) From: David Hildenbrand To: qemu-s390x@nongnu.org Date: Mon, 9 Apr 2018 13:30:19 +0200 Message-Id: <20180409113019.14568-3-david@redhat.com> In-Reply-To: <20180409113019.14568-1-david@redhat.com> References: <20180409113019.14568-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 11:30:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 09 Apr 2018 11:30:28 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v1 for-2.12 2/2] s390x: load_psw() should only exchange the PSW for KVM 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: Thomas Huth , David Hildenbrand , Cornelia Huck , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , 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" Let's simplify it a bit. On some weird circumstances we would have tried to recompute watchpoints when running under KVM. Signed-off-by: David Hildenbrand Acked-by: Christian Borntraeger Reviewed-by: Thomas Huth --- target/s390x/helper.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/s390x/helper.c b/target/s390x/helper.c index 615fa24ab9..e8548f340a 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -103,16 +103,18 @@ void load_psw(CPUS390XState *env, uint64_t mask, uint= 64_t addr) =20 env->psw.addr =3D addr; env->psw.mask =3D mask; - if (tcg_enabled()) { - env->cc_op =3D (mask >> 44) & 3; + + /* KVM will handle all WAITs and trigger a WAIT exit on disabled_wait = */ + if (!tcg_enabled()) { + return; } + env->cc_op =3D (mask >> 44) & 3; =20 if ((old_mask ^ mask) & PSW_MASK_PER) { s390_cpu_recompute_watchpoints(CPU(s390_env_get_cpu(env))); } =20 - /* KVM will handle all WAITs and trigger a WAIT exit on disabled_wait = */ - if (tcg_enabled() && (mask & PSW_MASK_WAIT)) { + if (mask & PSW_MASK_WAIT) { s390_handle_wait(s390_env_get_cpu(env)); } } --=20 2.14.3