From nobody Thu May  8 12:21:39 2025
Delivered-To: importer@patchew.org
Authentication-Results: mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass(p=none dis=none)  header.from=linaro.org
ARC-Seal: i=1; a=rsa-sha256; t=1588596014; cv=none;
	d=zohomail.com; s=zohoarc;
	b=DiZk4RPAV+mPDbGJd4jivrp0Ue6szsuKDww5lSXllaQ+nFJ28pwzg7TnCy7emj8eWnL9qYJksjnBtzynPMUHGdPpCHLAnXykYTLIiyA+HeVuxvMf4DaGsXgs685dg3qMoC1O4jnMcXd8tcj/pTDM0/zoIuz+zLzIZNCdw6m97/U=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1588596014;
 h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To;
	bh=LQncQVuc9PNxrpkqh3ABgysYVzrhk3KqSd8QlCpLW+s=;
	b=lk1IQZ6r8YDXrqV8itj9Fbuq9iZJz/6/o6ob2vhoCuiPhK8j7cwDkpX5McmH9FLIP5jgD9WiyHav6UIUhRsZ/8BaXGh7hAOh6inG/IieQNbmVwW2uGi891NZuOn87gDwo4Og33lXcI8QhKy4E8ChSvADtg7nUJxxYu7viDLdepU=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass;
	spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as
 permitted sender)
  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org;
	dmarc=pass header.from=<peter.maydell@linaro.org> (p=none dis=none)
 header.from=<peter.maydell@linaro.org>
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1588596014595597.0934015452777;
 Mon, 4 May 2020 05:40:14 -0700 (PDT)
Received: from localhost ([::1]:33082 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>)
	id 1jVaOL-0003ou-2c
	for importer@patchew.org; Mon, 04 May 2020 08:40:13 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56414)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)
 id 1jVaHj-0008Kt-Ah
 for qemu-devel@nongnu.org; Mon, 04 May 2020 08:33:23 -0400
Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:52223)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)
 id 1jVaHh-0000o8-JZ
 for qemu-devel@nongnu.org; Mon, 04 May 2020 08:33:23 -0400
Received: by mail-wm1-x344.google.com with SMTP id x4so8236947wmj.1
 for <qemu-devel@nongnu.org>; Mon, 04 May 2020 05:33:20 -0700 (PDT)
Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148])
 by smtp.gmail.com with ESMTPSA id q4sm12253608wrx.9.2020.05.04.05.33.18
 for <qemu-devel@nongnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 04 May 2020 05:33:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;
 h=from:to:subject:date:message-id:in-reply-to:references:mime-version
 :content-transfer-encoding;
 bh=LQncQVuc9PNxrpkqh3ABgysYVzrhk3KqSd8QlCpLW+s=;
 b=xry39U1UhQbES9/4j7X8IeN2FFv+CeANO85nnQGpgeYzIQ2TOoWnLQTLzhetXlsGdR
 qqQqDC/1XlDNJx7kCQRI0NuETIFh+einE4KccUN4o651KM3C7PWyYdbtCT7M9D+rFSR7
 9e/80kcTMp8AQ5DjpwjN3lpHPFAbsVvYaiqdgbbFfLKOtu4ksXDhDfWYFn/jnY4MAmNx
 8YkAt0kYv1krL9Ik24FwOql7XUFAB3OXiRaLr6JXKMrQl3DrC3LbtqpKCD9/oPqjbqNH
 gdg4mbvKbVAm8339KUYZUBYibUZx5rlGHE+8gL+u0g1WsseqUP9YtTh7bS32gE7hsQDQ
 +QQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=LQncQVuc9PNxrpkqh3ABgysYVzrhk3KqSd8QlCpLW+s=;
 b=heBr76aFMFIj8xVvWj+4lexjD2d1DDZnGjpOcM4dPEp1Wbjk3KD9hN/M4OCt0pY2YC
 4shoDhoxoYSwz7ctnR1r0iC2lzIpl0+y5INJ+NUc4c37SkGiMwAuCFGl2Tv2kelUyh4w
 8Yn/YRpS6yOTz5nQg5ZlVjKtD6vZ6jORJozGLjJcpajlf7BgWvERUAuRQUm/K/tNuPP/
 0191xc8VzwNOrU1PRNCZzTX6F94K+eh6bLx34C+Idd7dF7dTpFKJM12ZWITtAbKLxmJF
 +mholR3SwmJSG9ys4q0mb1j7F3llijBbSStT3hD1UL/nnS1nk5ENEzIi2LAFxbDozFDy
 K+vw==
X-Gm-Message-State: AGi0PuaADaEJN+OSNctL2qzAV4/YferxwMWdfj6SuHPuozw+3IGV01cR
 qiuUPnzkESV8CWD9cpI9vBKoBXVTbqzrpg==
X-Google-Smtp-Source: 
 APiQypKo71ywZOHFC0zdbI+T8n2MPN3dhD1bu6ZuzsRCIAzUE3btZV8Uk6Vc845w5Z5Go1oyz3PDVw==
X-Received: by 2002:a1c:bc09:: with SMTP id m9mr13895725wmf.145.1588595599764;
 Mon, 04 May 2020 05:33:19 -0700 (PDT)
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 07/39] target/arm: Use correct variable for setting 'max' cpu's
 ID_AA64DFR0
Date: Mon,  4 May 2020 13:32:37 +0100
Message-Id: <20200504123309.3808-8-peter.maydell@linaro.org>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20200504123309.3808-1-peter.maydell@linaro.org>
References: <20200504123309.3808-1-peter.maydell@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17
 as permitted sender) client-ip=209.51.188.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Received-SPF: pass client-ip=2a00:1450:4864:20::344;
 envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x344.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
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_PASS=-0.001,
 URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org>
X-ZohoMail-DKIM: pass (identity @linaro.org)

In aarch64_max_initfn() we update both 32-bit and 64-bit ID
registers.  The intended pattern is that for 64-bit ID registers we
use FIELD_DP64 and the uint64_t 't' register, while 32-bit ID
registers use FIELD_DP32 and the uint32_t 'u' register.  For
ID_AA64DFR0 we accidentally used 'u', meaning that the top 32 bits of
this 64-bit ID register would end up always zero.  Luckily at the
moment that's what they should be anyway, so this bug has no visible
effects.

Use the right-sized variable.

Fixes: 3bec78447a958d481991
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Reviewed-by: Philippe Mathieu-Daud=C3=A9 <f4bug@amsat.org>
Message-id: 20200423110915.10527-1-peter.maydell@linaro.org
---
 target/arm/cpu64.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index e232c0ea12c..9bdf75b1abb 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -710,9 +710,9 @@ static void aarch64_max_initfn(Object *obj)
         u =3D FIELD_DP32(u, ID_MMFR4, XNX, 1); /* TTS2UXN */
         cpu->isar.id_mmfr4 =3D u;
=20
-        u =3D cpu->isar.id_aa64dfr0;
-        u =3D FIELD_DP64(u, ID_AA64DFR0, PMUVER, 5); /* v8.4-PMU */
-        cpu->isar.id_aa64dfr0 =3D u;
+        t =3D cpu->isar.id_aa64dfr0;
+        t =3D FIELD_DP64(t, ID_AA64DFR0, PMUVER, 5); /* v8.4-PMU */
+        cpu->isar.id_aa64dfr0 =3D t;
=20
         u =3D cpu->isar.id_dfr0;
         u =3D FIELD_DP32(u, ID_DFR0, PERFMON, 5); /* v8.4-PMU */
--=20
2.20.1