Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A67FFC433F5 for ; Thu, 27 Jan 2022 22:29:22 +0000 (UTC) Received: from localhost ([::1]:56562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDDGb-0003Q1-BT for qemu-devel@archiver.kernel.org; Thu, 27 Jan 2022 17:29:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDDFz-0002ZG-UU; Thu, 27 Jan 2022 17:28:43 -0500 Received: from zero.eik.bme.hu ([152.66.115.2]:12595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDDFs-0001d3-PT; Thu, 27 Jan 2022 17:28:43 -0500 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 2D0F1746369; Thu, 27 Jan 2022 23:28:33 +0100 (CET) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 0D6557457EF; Thu, 27 Jan 2022 23:28:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 0BEB47456E3; Thu, 27 Jan 2022 23:28:33 +0100 (CET) Date: Thu, 27 Jan 2022 23:28:33 +0100 (CET) From: BALATON Zoltan To: Fabiano Rosas Subject: Re: [PATCH v2 8/8] target/ppc: 74xx: Set SRRs directly in exception code In-Reply-To: <20220127201116.1154733-9-farosas@linux.ibm.com> Message-ID: References: <20220127201116.1154733-1-farosas@linux.ibm.com> <20220127201116.1154733-9-farosas@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=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: , Cc: danielhb413@gmail.com, mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Thu, 27 Jan 2022, Fabiano Rosas wrote: > The 74xx does not have alternate/hypervisor Save and Restore > Registers, so we can set SRR0 and SRR1 directly. > > Signed-off-by: Fabiano Rosas > --- > target/ppc/excp_helper.c | 13 ++----------- > 1 file changed, 2 insertions(+), 11 deletions(-) > > diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c > index b7921c0956..4e6bb87b70 100644 > --- a/target/ppc/excp_helper.c > +++ b/target/ppc/excp_helper.c > @@ -556,7 +556,6 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) > CPUState *cs = CPU(cpu); > CPUPPCState *env = &cpu->env; > target_ulong msr, new_msr, vector; > - int srr0, srr1; > > if (excp <= POWERPC_EXCP_NONE || excp >= POWERPC_EXCP_NB) { > cpu_abort(cs, "Invalid PowerPC exception %d. Aborting\n", excp); > @@ -575,10 +574,6 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) > */ > new_msr = env->msr & ((target_ulong)1 << MSR_ME); > > - /* target registers */ > - srr0 = SPR_SRR0; > - srr1 = SPR_SRR1; > - > /* > * Hypervisor emulation assistance interrupt only exists on server > * arch 2.05 server or later. > @@ -731,10 +726,6 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) > cpu_abort(cs, "Trying to deliver HV exception (MSR) %d with " > "no HV support\n", excp); > } If we have ho MSR_HVB why is this still here? Shouldn't it have been gone in patch 2? Or is this still reachable? Regards, BALATON Zoltan > - if (srr0 == SPR_HSRR0) { > - cpu_abort(cs, "Trying to deliver HV exception (HSRR) %d with " > - "no HV support\n", excp); > - } > } > > /* > @@ -746,10 +737,10 @@ static void powerpc_excp_74xx(PowerPCCPU *cpu, int excp) > } > > /* Save PC */ > - env->spr[srr0] = env->nip; > + env->spr[SPR_SRR0] = env->nip; > > /* Save MSR */ > - env->spr[srr1] = msr; > + env->spr[SPR_SRR1] = msr; > > powerpc_set_excp_state(cpu, vector, new_msr); > } >