From nobody Tue Feb 10 23:01:08 2026 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 152328739235196.20198548180781; Mon, 9 Apr 2018 08:23:12 -0700 (PDT) Received: from localhost ([::1]:46089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5YdK-0003r9-6b for importer@patchew.org; Mon, 09 Apr 2018 11:23:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5YWS-0006CX-FC for qemu-devel@nongnu.org; Mon, 09 Apr 2018 11:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5YWR-0005cy-Is for qemu-devel@nongnu.org; Mon, 09 Apr 2018 11:15:56 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43028 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 1f5YWR-0005cB-DN; Mon, 09 Apr 2018 11:15:55 -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 0B77011DAE9; Mon, 9 Apr 2018 15:15:55 +0000 (UTC) Received: from localhost (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA392215CDC6; Mon, 9 Apr 2018 15:15:54 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Mon, 9 Apr 2018 17:15:33 +0200 Message-Id: <20180409151533.2253-9-cohuck@redhat.com> In-Reply-To: <20180409151533.2253-1-cohuck@redhat.com> References: <20180409151533.2253-1-cohuck@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.1]); Mon, 09 Apr 2018 15:15:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 09 Apr 2018 15:15:55 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@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] [PULL for-2.12 8/8] 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 , qemu-s390x@nongnu.org, 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" From: David Hildenbrand Let's simplify it a bit. On some weird circumstances we would have tried to recompute watchpoints when running under KVM. load_psw() is called from do_restart_interrupt() during a SIGP RESTART if the target CPU is STOPPED. Let's touch watchpoints only in the TCG case - where they are used for PER emulation. Signed-off-by: David Hildenbrand Message-Id: <20180409113019.14568-3-david@redhat.com> Acked-by: Christian Borntraeger Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- 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