From patchwork Mon Jun 21 09:58:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 464500 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp2425043jao; Mon, 21 Jun 2021 03:27:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnkd89TDFeFYtAgaA0i152O4w/h9PRi84WBbHjy2tyGGGZQ+vShXpSX3iHMiwjad10qHdP X-Received: by 2002:a37:6609:: with SMTP id a9mr22518658qkc.459.1624271244535; Mon, 21 Jun 2021 03:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624271244; cv=none; d=google.com; s=arc-20160816; b=0YriRvhgzMmqdsSMZD1R+9j6dhMHCXi9Jphk2DKXQ7yBIh+Rc8C/9QPbN49ir8hYqm KNf+TWtZc3qN1SWVIt/80VArK1Ti5pCDzPxXziXunzYc9lZnictpEaL6fXh0Fs5h9Uao 53WYF9dWLR+Eq4O5GYPhEd/JA9ODJnQfWlVNBGrewT2C6/wl3Lm5PHI4YlPhveTIIonR FkEnZdsUIP/6GAdKig8fJs7w0UFVXxgHT13ogDmM9IO5VQGUjBTuIWUNWnFXrRhTc+FA rmpMvOQhnjW/LoUvUc1wc9maOR/RiZDWbY2zuAT3fLsl/CRxtyN1xop57tv1HsS/QERs vLdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=JkdYmZdPED+GvBFFIrO27SJ74AlV6P/x47lw7kyteok=; b=CAyLLgl0SBs+GrAHSn2Pn8nSH9HOVMVMy4IrPzKBU3KmjICswXA6jSchz2knKSqs24 Z2z+tyb6wNY5xodRJqQGTARMrxuQ3kp72+3IrpvKPATIOebCbvTcdltPsgRfiITVHse8 cO9BRq7sYI79Fpf1N8k8wXtXPJREpNRMOHwHcGT5Ts56tvZWgMaUU4tdWaUdWJFi6vkm YnYOpFB2tLtvBp2T7QuzlB/byVtgxL9ZvEsf73yUu+VoQZg6Muoo/mQGP3Og8AkElA3g r2QGrzFWzNytilsAjyr30pwOBUPDctrk5wy1oRzwFktJ7RWQjVzhsEG+P71fPuy6faV8 LxBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=aaoGT45y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b13si2984428qka.113.2021.06.21.03.27.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jun 2021 03:27:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=aaoGT45y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:54866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvH9H-0003fN-UE for patch@linaro.org; Mon, 21 Jun 2021 06:27:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvGip-0008CY-W0 for qemu-devel@nongnu.org; Mon, 21 Jun 2021 06:00:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvGin-0007Et-VE for qemu-devel@nongnu.org; Mon, 21 Jun 2021 06:00:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1624269601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JkdYmZdPED+GvBFFIrO27SJ74AlV6P/x47lw7kyteok=; b=aaoGT45y3/3C1MIwx/Gq9VTb1O7OF66HAVFKlEkSZ+xYrjP12vD/f6UBIJFw1US0J+1uTm PiawiLWDL+tie7Xg8zGM+IFvF0xBmiO4sG98hwkobtQTPZxom0uEtTP/BupNEMDFOuZOZa ois7TVqvB8LPYNwN7AwBoZtTJuba7vA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-453-Lpip3jegOg6e0jXHR8bOEw-1; Mon, 21 Jun 2021 05:59:59 -0400 X-MC-Unique: Lpip3jegOg6e0jXHR8bOEw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62CD58042F3; Mon, 21 Jun 2021 09:59:58 +0000 (UTC) Received: from gondolin.fritz.box (ovpn-113-141.ams2.redhat.com [10.36.113.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0DD45D740; Mon, 21 Jun 2021 09:59:56 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Subject: [PULL 30/37] target/s390x: Do not modify cpu state in s390_cpu_get_psw_mask Date: Mon, 21 Jun 2021 11:58:35 +0200 Message-Id: <20210621095842.335162-31-cohuck@redhat.com> In-Reply-To: <20210621095842.335162-1-cohuck@redhat.com> References: <20210621095842.335162-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.299, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ruixin.bao@ibm.com, "jonathan . albrecht" , David Hildenbrand , Cornelia Huck , Richard Henderson , qemu-devel@nongnu.org, qemu-s390x@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We want to use this function for debugging, and debug should not modify cpu state (even non-architectural cpu state) lest we introduce heisenbugs. Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand Tested-by: jonathan.albrecht Tested-by: Message-Id: <20210615030744.1252385-3-richard.henderson@linaro.org> Signed-off-by: Cornelia Huck --- target/s390x/helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.31.1 diff --git a/target/s390x/helper.c b/target/s390x/helper.c index d311903b94ca..559fc3573fe3 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -321,12 +321,12 @@ uint64_t s390_cpu_get_psw_mask(CPUS390XState *env) uint64_t r = env->psw.mask; if (tcg_enabled()) { - env->cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, - env->cc_vr); + uint64_t cc = calc_cc(env, env->cc_op, env->cc_src, + env->cc_dst, env->cc_vr); + assert(cc <= 3); r &= ~PSW_MASK_CC; - assert(!(env->cc_op & ~3)); - r |= (uint64_t)env->cc_op << 44; + r |= cc << 44; } return r;