From nobody Tue Dec 24 13:54:58 2024 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=flygoat.com ARC-Seal: i=1; a=rsa-sha256; t=1734910888; cv=none; d=zohomail.com; s=zohoarc; b=EZQIreyw5etOcOpbSe44JqasyBM0fFVs0nNGZddjcOpQEddwr5SAXK6T/cAQf1rFHEXWuLaQIyNuNIh7DHomYJLzFX1ZSNJmp3GWJSjhzDaV8zbnFhUOpFbV/znGT6H1uVg0Abm3N/uwYV1XMInO+WRZGkGFMpcY4BGRgI7cz/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734910888; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7cTwzH7RtaLWxerE/3oHVhOon4cSx5BIeYCAgA/5kJk=; b=f84TRi7LSapwbdS5jJkOy+M5WQ/LwE20FAMZdbHCDs72vssEuGExWzioAcu6TrlNDLOS7EfFn0bqfb2CbWrET9GZ59vIjNd03dWgw8tzQdSc3QSYzLya1PXnvO3LL3CIntJDYwEb9HUqfKT/ivqp9Xd13IsRXw7mMdjpS+H6MXQ= 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= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734910888691649.0002876303572; Sun, 22 Dec 2024 15:41:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPVYy-0000L7-Eo; Sun, 22 Dec 2024 18:40:45 -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 1tPVYr-0000Jw-7B for qemu-devel@nongnu.org; Sun, 22 Dec 2024 18:40:37 -0500 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPVYm-0006BS-7J for qemu-devel@nongnu.org; Sun, 22 Dec 2024 18:40:36 -0500 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id ACA7F13801AD; Sun, 22 Dec 2024 18:40:31 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sun, 22 Dec 2024 18:40:31 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 22 Dec 2024 18:40:30 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1734910831; x=1734997231; bh=7cTwzH7RtaLWxerE/3oHVhOon4cSx5BIeYCAgA/5kJk=; b= lCjypm0UvXvpS7HYklL1J/MtXxkvvclFBwFNrSZ8hsR2YA+RPJZVOBHAEMJaXmwy ou3i/I6bzZQ9RcrmaYJBjTBVXSawZ+KkxztZVSPu3iQRVcuLTtK6RpQ3nDWCOhtk 856VRSpgR+KCIzHPcqIUwkU4sUFP7jO6yP4rdD4QlE4lA6tBgz8trBlc67SzvL9o /7cYM77q7Bv6e1lZYmLxxC7mcDVc/XVMVNJUUOD3/8Uddbpr3FGmRYXRVYEfPso0 z2NAAoqYVBL38qzxZtw6vaAPpNhtHvEoc9FJShRN5Fvr5RgP6/w2ZyM5nKFAz6lT YPP510AFcZ3BMdfRPWc3WQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1734910831; x= 1734997231; bh=7cTwzH7RtaLWxerE/3oHVhOon4cSx5BIeYCAgA/5kJk=; b=v R8ed9WDV8BJqD74DR+7F4hqkgoDmZFHsj+bIK/vZ9wFbssloRD+xLh9LpL7Yqpgj gmUjI9ZhTMH8vBWK6OdwPWa8h39fAfLtxQlTL890BMuhFrbNB9TPRkABUgba0seS eKRsf1Xcq7XLkNVLUeSpbCmfcPr1rg/XhJc/1cWMFkqBt/Qk0oYjnkJg7+HLk9o/ SYO22b7240lzj+LCgoTBqRQ7/BICOtQ0bITq5LHWBaLYtDGmBbiMmm1xeD97emyU FKVwBLi9Y9JxiBqG9uja3E1fqhLS0Grf6jzi8Ri/WXiUZUnNjKNoCKcIeDE7PRBg 3REIJRsG/7meDDp+cjz0w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtledguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertdertdej necuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepvdekiefhfeevkeeuveetfeelffek gedugefhtdduudeghfeuveegffegudekjeelnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdr tghomhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epqhgvmhhuqdguvghvvghlsehnohhnghhnuhdrohhrghdprhgtphhtthhopehjihgrgihu nhdrhigrnhhgsehflhihghhorghtrdgtohhmpdhrtghpthhtohepghgrohhsohhngheslh hoohhnghhsohhnrdgtnh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail From: Jiaxun Yang Date: Sun, 22 Dec 2024 23:40:27 +0000 Subject: [PATCH 3/3] target/loongarch: Fix PGD CSR for LoongArch32 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241222-la32-fixes1-v1-3-8c62b7e594db@flygoat.com> References: <20241222-la32-fixes1-v1-0-8c62b7e594db@flygoat.com> In-Reply-To: <20241222-la32-fixes1-v1-0-8c62b7e594db@flygoat.com> To: qemu-devel@nongnu.org Cc: Song Gao , Jiaxun Yang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=891; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=HMr2rCyjGnWHqISfDv+dvbEaVA1bYvHdaH0R/IQObZI=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhvSMxVnTV7WuX3a2ev0C24dKP7W6HU+um8Z7amoPz4OYA 00M2/6t6yhlYRDjYpAVU2QJEVDq29B4ccH1B1l/YOawMoEMYeDiFICJ7GdlZHh+5X6W+rutJq+2 ZTzy/xVbl2m2UXbC9z0/vsjKzQ5lMbJj+J/eKCf0y/6tyJtzEarcPKadG1eFRMxzMUvb4LxRe/X 6dC4A X-Developer-Key: i=jiaxun.yang@flygoat.com; a=openpgp; fpr=980379BEFEBFBF477EA04EF9C111949073FC0F67 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=103.168.172.150; envelope-from=jiaxun.yang@flygoat.com; helo=fout-a7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @flygoat.com) X-ZM-MESSAGEID: 1734910891944116600 As per manual, the source of PGD CSR is relevant to highest bit of BADV. In LoongArch32, all CSRs are 32 bits only, thus we should check bit 31 of BADV to determine PGDH/PGDL for LoongArch32. Signed-off-by: Jiaxun Yang --- target/loongarch/tcg/csr_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/loongarch/tcg/csr_helper.c b/target/loongarch/tcg/csr_h= elper.c index 15f94caefabc7722263fa46e948e21de37b4203c..ca8100eedfb37fd3b45b3de0c0f= c0fad599c4685 100644 --- a/target/loongarch/tcg/csr_helper.c +++ b/target/loongarch/tcg/csr_helper.c @@ -26,7 +26,7 @@ target_ulong helper_csrrd_pgd(CPULoongArchState *env) v =3D env->CSR_BADV; } =20 - if ((v >> 63) & 0x1) { + if (v >> (is_la64(env) ? 63 : 31) & 0x1) { v =3D env->CSR_PGDH; } else { v =3D env->CSR_PGDL; --=20 2.43.0