From nobody Fri Apr 4 05:12:50 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=flygoat.com ARC-Seal: i=1; a=rsa-sha256; t=1740444192; cv=none; d=zohomail.com; s=zohoarc; b=fxm+0Uqzjk6hQbDkJhkuusxqO7yr5xq1wGBV0AAJor5iEgUoPyQC5IDxNXAFwp0h0Hq48aNPMk8YNvx6qUek/qoQgkHTCPimzwMGJgF+saxNK+80zQtththNGZOVioDZs7T91qGF+K4uqRN1G1m90WcTPhoYUUTdHCo9ysTcdDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740444192; 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=S4LKGFTypIdV3P5Y7CtYczPKE/btLEKjM8yejT9DHdU=; b=JGXSIfNByOkT0/lJyvalIw/AHunWCOjJNl7jsHeLd5F+bU2tROEXtX/DXdteSB//juC8e6Pn3BC6KhzlwUUGeMKavHKCafxJoOGpPQg8hsRNH1EsQlN1VOve0ecJsFN0wsNq/kbbPWbF0wX1lq+HHVAs+xnTeorRb6udPzLgCfg= 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 1740444192636899.9640290625766; Mon, 24 Feb 2025 16:43:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmj0R-0004dt-7E; Mon, 24 Feb 2025 19:41:05 -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 1tmizo-0004Xi-Nx for qemu-devel@nongnu.org; Mon, 24 Feb 2025 19:40:24 -0500 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tmizm-0003S0-Vl for qemu-devel@nongnu.org; Mon, 24 Feb 2025 19:40:24 -0500 Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0198925400EE; Mon, 24 Feb 2025 19:40:20 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Mon, 24 Feb 2025 19:40:21 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 Feb 2025 19:40:20 -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=fm2; t=1740444020; x=1740530420; bh=S4LKGFTypIdV3P5Y7CtYczPKE/btLEKjM8yejT9DHdU=; b= KJjpzDB2TT3ATuyaKfndMhqPdSZzYvy780W/+Ykje6PiDxWE8NSPh+zWJuHvYDT7 5R37/s5LhP6MCz1s1um2CocyJJZ0+YEeqrmYYJNCT/zSFWpb0j9Bn5nliOtcWIBP olyseqIzlz9EliGdxEYyradkZuhvONpnpQI4zKel/QKAAvRUr41Fd+kG7OpNqE5T NWhVbaQa95Th5lq+2nIPP+WHQVNskBSmt6/B9XUUp6A9VW+XcuQKFy2XDvlKYLNw gIr6+WacaWDPC15YWW/Tyq73cNZed5IbmUaFHpiOGnCdCP3MAL0J6/Ew0lDVtGbU OxnvsGGUZHsnM411FknDjQ== 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=fm1; t=1740444020; x= 1740530420; bh=S4LKGFTypIdV3P5Y7CtYczPKE/btLEKjM8yejT9DHdU=; b=W bsdpPqJqSMLmQ+VkUc8ftYxCg/o6jFDOC3utYQvVRKZvOhe0nDZOd1T3M8lnSg0X 1PEgVOMJtut1IANh/S9AdOyLCcjszS7MpbNARZn6K8Zk8vsNqErebnApOTgdxKNC elKDbvVkXoy9keNmVj+BDJwUguTaaX0YAUfYqVuosl3dMIiC7/9hrBMfnkjlFpXg GmM9h1dE4IBf86n5aiWxHb+vk5YO9xIA/XPpZ8qM4KoU9HwQprAH3tub7CvlCY7R i0Rz63xiDSmBhg7IODwDo7g8rVHoZg18KOj2iAht/UlQEEL8B3I1xpWWghhxdxk5 8ZbYXm7IV6dpx00KhWETg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdektddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflh ihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpedvkeeihfefveekueevteefleff keegudeghfdtuddugefhueevgeffgedukeejleenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorght rdgtohhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtth hopehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmpdhrtghpthhtohepghgr ohhsohhngheslhhoohhnghhsohhnrdgtnhdprhgtphhtthhopehqvghmuhdquggvvhgvlh esnhhonhhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: ifd894703:Fastmail From: Jiaxun Yang Date: Tue, 25 Feb 2025 00:40:16 +0000 Subject: [PATCH v2 3/9] 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: <20250225-la32-fixes1-v2-3-8ec68ada3dd5@flygoat.com> References: <20250225-la32-fixes1-v2-0-8ec68ada3dd5@flygoat.com> In-Reply-To: <20250225-la32-fixes1-v2-0-8ec68ada3dd5@flygoat.com> To: qemu-devel@nongnu.org Cc: Song Gao , Jiaxun Yang X-Mailer: b4 0.14.2 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=202.12.124.157; envelope-from=jiaxun.yang@flygoat.com; helo=fhigh-b6-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_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1740444193018019000 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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..821aa6af46ea2129d771fdc937e= ca72317cefc1e 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 (extract64(v, is_la64(env) ? 63 : 31, 1)) { v =3D env->CSR_PGDH; } else { v =3D env->CSR_PGDL; --=20 2.43.0