From nobody Wed Apr 9 04:40:25 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=1735248219; cv=none; d=zohomail.com; s=zohoarc; b=PLV3ak5OdyKINJOAQuEPq3BmKzigimnfvRZX8O5BTXh7lsjBe/I+qy93bWnwNPmVCUvkFmCJZM9BwtiqZ5YEXEbMW/4x6uhndaEJdcw058ci/jvESgTkRfKw71IcIu2IiynRP/JxLPmX6opEDj8Jy7xm050bDENIrlPpNKcklTI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1735248219; 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=UWsqYfIH+7IFDxVTaM2y9Y2z8aXGlZyr+RpLiF9PEo96nH2E+ZjZ0tXr6+/MW5HXVix+XT8wHmNQyktO46TWueV2jt0ELbHLBdPHPAn81unpVJCdBsc51d37X/erH9CZ8QgO6KJdNN63GQErFJc7tKlZb1U/hHr575UhiVymjb8= 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 1735248219769553.4042646462783; Thu, 26 Dec 2024 13:23:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQvGq-0003e5-T4; Thu, 26 Dec 2024 16:19:52 -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 1tQvGq-0003dg-02 for qemu-devel@nongnu.org; Thu, 26 Dec 2024 16:19:52 -0500 Received: from fout-a1-smtp.messagingengine.com ([103.168.172.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQvGo-0002wU-M6 for qemu-devel@nongnu.org; Thu, 26 Dec 2024 16:19:51 -0500 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id BA25813801CA; Thu, 26 Dec 2024 16:19:49 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 26 Dec 2024 16:19:49 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Dec 2024 16:19:47 -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=1735247989; x=1735334389; bh=S4LKGFTypIdV3P5Y7CtYczPKE/btLEKjM8yejT9DHdU=; b= aa9RTjecAmw1+MPgV4EcIPNERKf9Kqwux9NLIK2qtI0D5YPv2Vl6MIZgvSGEl0dr aNNZW1wmTqBRfinzdAGpSupP0+Eo5Adigef46/qQ1ONjowsfZBtdRT7DDLgPzM7O dVkzo3V01Q7phf1XRByXEdxRmIEn+5qGwlCE9zdQ0+h4fLSGOP4Ck5Nj/hakCjn5 Yqn5dTAxwdz0mX1MY8tmRjcQAKybNTg6/zIkLaYhmNt94GnzuFpRWIE5cMVnMbkX bhH/N966ACYZmdHVsO6t+GDFW8dEdtOA/lruYt5KGPJjGUm+ou5SdLdR0FMWoTFJ bUuPtdZm3fZCaFOi+vRyHw== 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=1735247989; x= 1735334389; bh=S4LKGFTypIdV3P5Y7CtYczPKE/btLEKjM8yejT9DHdU=; b=d yL0X7VTCWfgmJLuAxeDasY7Gs3zNGWRqXQxvihynvrcJI/hPYm/Q2RU8JWhVOL7S dCrmLksbUQZ1A4CZi307LUS8FEX3BqYDuA3NjVHR8+yDpNT7I6tKsNXsfa86dnw4 bSLlp+aAue+dIVQ/O/wW+J81YHBpl4HBlj9j/B9O1au0Vfqa/klJRL53c4MZ0iKw taVpjhtwtOu/ry2a4KTjIdbgm2r4yRua/1aOy5+ktgpOfEK1phMgMDWMWMRNUuw8 deQnxpUTnMqsuXFs2SsN8yeSPUsidQjU7Z8Ge5oP/rT4tqVx8CuqvVF0vc/p5+yB u5TZyynmOPCoIindAKMqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddukedgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredt jeenucfhrhhomheplfhirgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflh ihghhorghtrdgtohhmqeenucggtffrrghtthgvrhhnpedvkeeihfefveekueevteefleff keegudeghfdtuddugefhueevgeffgedukeejleenucevlhhushhtvghrufhiiigvpedune curfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdrhigrnhhgsehflhihghhorght rdgtohhmpdhnsggprhgtphhtthhopeduvddpmhhouggvpehsmhhtphhouhhtpdhrtghpth htohepmhgrohgsihgsoheslhhoohhnghhsohhnrdgtnhdprhgtphhtthhopehmrghrtggv lhdrrghpfhgvlhgsrghumhesghhmrghilhdrtghomhdprhgtphhtthhopehpsghonhiiih hnihesrhgvughhrghtrdgtohhmpdhrtghpthhtohepghgrohhsohhngheslhhoohhnghhs ohhnrdgtnhdprhgtphhtthhopegvsghlrghkvgesrhgvughhrghtrdgtohhmpdhrtghpth htohepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomhdprhgtphhtthhopehq vghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhgpdhrtghpthhtohepfigrnhhghigrnh grnhehheeshhhurgifvghirdgtohhmpdhrtghpthhtohepiihhrghouddrlhhiuhesihhn thgvlhdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail From: Jiaxun Yang Date: Thu, 26 Dec 2024 21:19:34 +0000 Subject: [PATCH v2 03/23] 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: <20241226-la32-fixes1-v2-3-0414594f8cb5@flygoat.com> References: <20241226-la32-fixes1-v2-0-0414594f8cb5@flygoat.com> In-Reply-To: <20241226-la32-fixes1-v2-0-0414594f8cb5@flygoat.com> To: qemu-devel@nongnu.org Cc: Song Gao , Bibo Mao , Eric Blake , Markus Armbruster , Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Yanan Wang , Zhao Liu , Paolo Bonzini , Jiaxun Yang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=895; i=jiaxun.yang@flygoat.com; h=from:subject:message-id; bh=6C/XW5GxVl4u28OCGxlKZ9TASN0NONQ1NU6nHVutsUw=; b=owGbwMvMwCXmXMhTe71c8zDjabUkhvTcE9lsTzY9PN+sWKFevo9Bd2HitoACKamd7Y2LMyL4O KTmGAV2lLIwiHExyIopsoQIKPVtaLy44PqDrD8wc1iZQIYwcHEKwETmJDAybLBbVvdPP6Fc+HW+ jtSsI9vnsZ/i3HqsftPSeZILr3dd8GRkOBa3Yp70/Oc9qeIbpx868b22ytpW9lHVtfvqyof2cR3 6ygwA 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.144; envelope-from=jiaxun.yang@flygoat.com; helo=fout-a1-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_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: 1735248221768116600 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..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