From patchwork Tue Nov 5 11:19:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 840781 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp286226wry; Tue, 5 Nov 2024 03:23:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX52AgIn0sJZciOe5UQlROjem0ICP74Q0y9qsNXuIc3xm/Zsvcv9NVDGyQ/HTYWj4932k1Ykw==@linaro.org X-Google-Smtp-Source: AGHT+IGgljqp2vUQT6J/IkItCbMkk55VYJS/6oaYWrK7LBLJyPzeo0auyXIBiBDXzKvbxKysAfkD X-Received: by 2002:a05:622a:18a1:b0:460:ae0f:4708 with SMTP id d75a77b69052e-462b86579fcmr234117781cf.1.1730805817548; Tue, 05 Nov 2024 03:23:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730805817; cv=none; d=google.com; s=arc-20240605; b=RU+DeFuKhutGosTovUe5aeOdIZoPGdx0VCUxY0cbteZzUKf4dnhokwsvoxVceWJ5Wr P2bIaltJUCc/xTvrxE8TWxwkuBu6Fj/qc/ZQ5n3lgdkGMBdp6ZE7LflXD9NFX3YgXAcd EyK026uGr+AOg9i3MTZ9YBoJCNILUx2SAZurZ+XYTBSIpVG5+pKQM/6GY3O96+WSPrJa xJJN16RkEML5u8BFnuV634ECHP+QBVT9KvHNU4HwQgIsI/24zGcJ+fdRUojNKSMhmMDV ewxO6N5/7pvi8FRQuUEaUci1LF78P+JvQ3bL+JnEnmcDHdyO9/YltLq2054Z7EdADJ16 GK8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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=nlatDknV/aBfEnJ/+F3868r6flWSi/PVuWVtl184IcQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BRMpY/tpk6BgbN3Jljw6LL3NhgmjICz3pxoNdoDaLCiR6JFgO43Hhg32SqE9sFvtDL vkLYRyIHOQTz1uzEM4WJvoZ74yfgpLeGOeiAcInY3SXYbTC8CnTRYRJtW9yhU1arUXHw qPKK32GvqQR/9mPSO5LsCvwybmgBxT7Nwtiglgp0Kr/Nn1gRXY8VO9KliPy6GHUDh+Xm tW4dJPX8nyWazv8h+OVt6SWI/vUWacH2y5pvjr+ZlrMB5hwz42yClW7VyWgMrxFuNdLQ /5L1TlO4eGg4RDrLmnMu7uRMVeFF4hoqsDF6VFE/lcG12wl6sTjg2TAVTY+Vg7Cdh68o 50jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="B/i+lgDj"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ad27aed9si129028361cf.726.2024.11.05.03.23.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 03:23:37 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="B/i+lgDj"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8HbG-0004To-Q5; Tue, 05 Nov 2024 06:19:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8HbE-0004T1-7T for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:52 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8Hb9-00075v-Pu for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:51 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4315e62afe0so45658365e9.1 for ; Tue, 05 Nov 2024 03:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730805584; x=1731410384; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=nlatDknV/aBfEnJ/+F3868r6flWSi/PVuWVtl184IcQ=; b=B/i+lgDjbNc2cmEJ78MGIAZA81rNsG+EwUq4Q8nSDOMdFgmwAH/CW9nTsl9SeBxDhH uZYN5CWWYwwW/XqpnOtLsZZGHmVxtj6BEnV++CPdO/LlyStqs+9H0R6AYHIJWGDbbUgJ tZqpRCIRi3FkQzIdiOHapJxjxJHhnkgcIyzBwX/O3rc6ldsj0Xu9HNLKabs36Srb42uD bxr5UOnxw40peZ0ANgm61Pp4RzcXY45u4zP+PykzMJJrLcAvFWo2oOYfKaKRvMhlDn1N a4WafbSZSGy/5enSlkgIsnX6ZByMY1QzaZvf0Na7hMvJ6BMbPuYSRSf9eAgRV+4AkFZw XYhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730805584; x=1731410384; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nlatDknV/aBfEnJ/+F3868r6flWSi/PVuWVtl184IcQ=; b=dUgPHArDaDoeHxx5pq76kGumKYUxH1wgpfkLWDI0/CwZ9AgrF60j2fG4DSWG4jODTa deFqjzv45FuLX5H9LXDj1/oonfclG9wpEdqhPeZWV6A7V2Ztuk/QOxXeTBo+uh9Ej9hA IF8Rk/oVVR6bZHJs1DoksIK7VgLCTO53Dzawg9IDly0+VyyP2gcmknyxBSkNrnzEpZkh v3tVBFcQ5hP8A+qtwc1+whd7s2uRmyucsyUcBvfXFXD70ASFMdmxspbzrLn5bK/DAO34 WuCtQTtmPcShLXdd+Hb2CTul37miOubzy7tL4k0R9nspR3bvtJrqqllCIJih03eCo8Op wNeA== X-Gm-Message-State: AOJu0YyDsluXQze2ec27NcfGZwQBbe4Zyie00fkRF2+cEMpp7KvIPUhn kPGtrDVkGD3PRwZNppPtADljEOEUAQzVAjK7mpI+tFOxAhyV2QewnUH3UlFpUuMRF3f3e1FVjMP h X-Received: by 2002:a05:600c:cc5:b0:432:a36b:d896 with SMTP id 5b1f17b1804b1-432a36bd911mr16015845e9.26.1730805583796; Tue, 05 Nov 2024 03:19:43 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432a3688813sm16354555e9.1.2024.11.05.03.19.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 03:19:43 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 11/31] target/sparc: Move cpu_put_fsr(env, 0) call to reset Date: Tue, 5 Nov 2024 11:19:15 +0000 Message-Id: <20241105111935.2747034-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105111935.2747034-1-peter.maydell@linaro.org> References: <20241105111935.2747034-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Currently we call cpu_put_fsr(0) in sparc_cpu_realizefn(), which initializes various fields in the CPU struct: * fsr_cexc_ftt * fcc[] * fsr_qne * fsr It also sets the rounding mode in env->fp_status. This is largely pointless, because when we later reset the CPU this will zero out all the fields up until the "end_reset_fields" label, which includes all of these (but not fp_status!) Move the cpu_put_fsr(env, 0) call to reset, because that expresses the logical requirement: we want to reset FSR to 0 on every reset. This isn't a behaviour change because the fields are all zero anyway. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-id: 20241025141254.2141506-12-peter.maydell@linaro.org --- target/sparc/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 54cb269e0af..e7f4068a162 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -76,6 +76,7 @@ static void sparc_cpu_reset_hold(Object *obj, ResetType type) env->npc = env->pc + 4; #endif env->cache_control = 0; + cpu_put_fsr(env, 0); } #ifndef CONFIG_USER_ONLY @@ -805,7 +806,6 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error **errp) env->version |= env->def.maxtl << 8; env->version |= env->def.nwindows - 1; #endif - cpu_put_fsr(env, 0); cpu_exec_realizefn(cs, &local_err); if (local_err != NULL) {