Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4E56606A31A for ; Tue, 1 Dec 2026 20:17:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=khnez9hP Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYUHb-0005XM-63; Tue, 01 Dec 2026 15:16:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYUHX-0005WA-GS for qemu-devel@nongnu.org; Tue, 01 Dec 2026 15:16:55 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xYUHU-0001Cs-58 for qemu-devel@nongnu.org; Tue, 01 Dec 2026 15:16:55 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4bb69f5b161so81538065e9.0 for ; Tue, 01 Dec 2026 12:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796156210; x=1796761010; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=np4WTpx3l+r2zdeuPBb5TLK+82FrC6hr5/+hTzNNREs=; b=khnez9hPcGD8pGyWhjgh0liPdyNH7oW8wm0MpJHl+Y9mcNRS3MeyF6Pr+G79nKqTtH OwWa+ouDPwyD9uu3cO6CUp4QWFLgn0tX3XdYgmOmzpTIH+qFNrpcltNpt45DcysDso4S f03dVcdFzGPeIEQODq2pmjuSHFVETEFbNY/cpNhxlFpN2O/DsvnGIcFyR+a3ALcaJeDA LlfZzdJhMYsoKD6LsVTCD2V5sXEkCQkye3/zNpkNMTzL+mtFIhmZkPoZ3Ua3e5D0dJuV 93JvZLSuDBEgPhtEqVrHka5rOSAL+kWflEPWZjTx+mBgqRS485wMmHUiJmmvPn3qCC7P e52w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796156210; x=1796761010; h=content-transfer-encoding:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=np4WTpx3l+r2zdeuPBb5TLK+82FrC6hr5/+hTzNNREs=; b=MYIG7G3Uy705akf4M2xs9fz4TxbmN3FNvbfL5HmldFSHCd1SvxA6ajqjbOB11mOiDV bxAGSpGmUkAuZk4qLAsYFVzfjSZc4dTW+xW8Tg7ZPz4LXe0k10fK0begOZi+XdKPyKvB j5Wl7LccBpQMXoel7AyC/eU2M7yTNlDlCExYTtrAyP7eu7lYCfvD4m0XLly0HVyEiuO0 1E/JIufGTf4tqm8fCeXG/KkOFZbZgd646wBFI4kd29WbVqSxVWDYV1291lYeMHiHweTq FrwNH2PlS1niEIAIYtMwUpKxITo7KhDkhDGkLse6Pw633DOyV3TPESR8DhDljVdWnLsT iU+A== X-Forwarded-Encrypted: i=1; AL+hErG/YjBPUJVpEyLFSbkxkYN4c6Pi3kXfmiryT2DL2rixtnNty1SJVGEzJRg4N2VfUIALhWH/rzr67OnO@nongnu.org X-Gm-Message-State: APuU4Z9PsGtKPMs59CUyA+pIViVd68s6RLtVVnEWF41YGQ58MDtzMmRz ngU3/dOGxt9/oURCAmFvCMbBkZJZqMv4cdB0ylf99YrYutXr+HyHfPl8 X-Gm-Gg: AZFdTZfjfUgb8zAdm4oqKa6E0gQsTx6tOGMPN5KQsAnXo6ffti2AuICvAxk/CmAcCqE Vpw6PLsrIgE7DSH+KjWRsRuL2shEUzZr2zlbJNprB9gg13GdOy1H3gGbcq1/FojEuq1hF52b+iP dP5vU63N+jFyqtn2Lipva5XJIr6Mq+K8D5YNWsRHVs3NG/Codazj61iYuzwo+kM8gjaYotqHz62 npxNWdzc/wkQ7I2njD1+7MAQ+ChpUOBmS8iG+2GwmQC1c7yv4+RLs2ACm8oa04VoJbcyQ1/ODdc 64QKuOo03ERCm4SQSP2Bgqf6HT1JBUeMS0JGY9yCqfWmQH4vqP7J1S0VriMxaM4u+95K4tX2HmE 0xsFKPDaSWscGdx/9K3cTInG5+7v4tdVoQACS8i11UyhA0AjF8WFDO1P6NqPMlO+kBsYSMpMetr 48RJP3aoxa66KWpx4xeR2+GhciSaeYR8Wrw6lmfaiB4NVOluhhe7JmlNIONYhH0/Ai+FyBVIRK5 kgU1duEuRd0CS+yZK5bj2I2tl2o0I7Iiny4zSqGeTnJHW8W1kBe4srfsaGJSKwkfHy2qq52lail gCb69pSdiTRxp9Tc9Lon85xbeDBpGLQy9EFhCxri8T5iBc94cBOFZCONm69L2GTLb9v3LtQE7BR h84U4p+bwCrwNNSO1piQHM4sXnwEui3cRpxjU0xm8ngaTxILM X-Received: by 2002:a05:600c:3491:b0:4a2:c2b:a91b with SMTP id 5b1f17b1804b1-4bb8880014dmr797531135e9.10.1796156210086; Tue, 01 Dec 2026 12:16:50 -0800 (PST) Received: from ehlo.thunderbird.net (dynamic-2a02-3100-2cea-df00-0128-5990-37f3-7336.310.pool.telefonica.de. [2a02:3100:2cea:df00:128:5990:37f3:7336]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b110c3csm70028210f8f.36.2026.12.01.12.16.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 12:16:49 -0800 (PST) Date: Tue, 01 Dec 2026 20:16:48 +0000 From: Bernhard Beschow To: Bin Meng , QEMU CC: =?ISO-8859-1?Q?Philippe_Mathieu-Daud=E9?= , qemu-stable@nongnu.org, Chinmay Rath , Glenn Miles , Harsh Prateek Bora , Nicholas Piggin , qemu-ppc@nongnu.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v3_01/23=5D_target/ppc=3A_Co?= =?US-ASCII?Q?rrect_PIR_write_access_on_e500_cores?= In-Reply-To: <20261108120034.1755008-2-bin.meng@processmission.com> References: <20261108120034.1755008-1-bin.meng@processmission.com> <20261108120034.1755008-2-bin.meng@processmission.com> Message-ID: <8FBCB3E5-0FA6-4E48-8D19-16F43D5E16FD@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=shentey@gmail.com; helo=mail-wm1-x334.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Am 8=2E November 2026 12:00:00 UTC schrieb Bin Meng : >The BookE PIR registration reuses the classic PowerPC 604 write >callback, which writes SPR 1023 and masks the value to four bits=2E >BookE PIR is SPR 286; on e500, SPR 1023 is SVR, so a PIR write can >corrupt SVR while leaving PIR unchanged=2E > >The e500v1/e500v2 manual defines PIR as read-only=2E The e500mc, e5500 >and e6500 manuals allow hypervisor software to write PIR after reset=2E >Reject writes on e500v1/e500v2 and use the generic 32-bit SPR write >callback on the other three cores to update the correct register >without the four-bit restriction=2E > >Fixes: 76a66253e5e4 ("Great PowerPC emulation code resynchronisation and = improvments") >Cc: qemu-stable@nongnu=2Eorg >Signed-off-by: Bin Meng > >--- >Reference: >- E500CORERM (Rev=2E1), section 2=2E5=2E2 > https://www=2Enxp=2Ecom/docs/en/reference-manual/E500CORERM=2Epdf >- E500MCRM (Rev=2E3), section 2=2E9=2E7 > https://www=2Enxp=2Ecom/docs/en/reference-manual/E500MCRM=2Epdf >- E5500RM (Rev=2E4), section 2=2E9=2E7 > https://www=2Enxp=2Ecom/webapp/Download?colCode=3DE5500RM >- E6500RM (Rev=2E0), section 2=2E9=2E8 > https://www=2Enxp=2Ecom/docs/en/reference-manual/E6500RM=2Epdf > >(no changes since v1) > > target/ppc/cpu_init=2Ec | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/target/ppc/cpu_init=2Ec b/target/ppc/cpu_init=2Ec >index 7f3036d903=2E=2E9731bc0bfa 100644 >--- a/target/ppc/cpu_init=2Ec >+++ b/target/ppc/cpu_init=2Ec >@@ -2837,7 +2837,9 @@ static void init_proc_e500(CPUPPCState *env, int ve= rsion) > /* Processor identification */ > spr_register(env, SPR_BOOKE_PIR, "PIR", > SPR_NOACCESS, SPR_NOACCESS, >- &spr_read_generic, &spr_write_pir, >+ &spr_read_generic, >+ (version =3D=3D fsl_e500v1 || version =3D=3D fsl_e500v2= ) ? >+ SPR_NOACCESS : &spr_write_generic32, > 0x00000000); AFAICS e500v2 cores allow for writing the PIR register: =2E If the write is turned into a no-op th= en I can get u-boot to work on my e500-fdt branch [1], booting all the way = into a graphical Linux system=2E Best regards, Bernhard [1] https://github=2Ecom/shentok/qemu/tree/e500-fdt >=20 > spr_register(env, SPR_BOOKE_SPEFSCR, "SPEFSCR",