[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi
From: |
Cédric Le Goater |
Subject: |
[PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi |
Date: |
Mon, 31 Jan 2022 12:07:32 +0100 |
From: Christophe Leroy <christophe.leroy@csgroup.eu>
After a TLB miss exception, GPRs 0-3 must be restored on rfi.
This is managed by hreg_store_msr() which is called by do_rfi()
However, hreg_store_msr() does it if MSR[TGPR] is unset in the
passed MSR value.
The problem is that do_rfi() is given the content of SRR1 as
the value to be set in MSR, but TGPR bit is not part of SRR1
and that bit is used for something else and is sometimes set
to 1, leading to hreg_store_msr() not restoring GPRs.
So, do the same way as for POW bit, force clearing it.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Cedric Le Goater <clg@kaod.org>
Cc: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220120103824.239573-1-christophe.leroy@csgroup.eu>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/excp_helper.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index bc646c67a0f5..980f62fd7964 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -1164,6 +1164,10 @@ static void do_rfi(CPUPPCState *env, target_ulong nip,
target_ulong msr)
/* MSR:POW cannot be set by any form of rfi */
msr &= ~(1ULL << MSR_POW);
+ /* MSR:TGPR cannot be set by any form of rfi */
+ if (env->flags & POWERPC_FLAG_TGPR)
+ msr &= ~(1ULL << MSR_TGPR);
+
#if defined(TARGET_PPC64)
/* Switching to 32-bit ? Crop the nip */
if (!msr_is_64bit(env, msr)) {
--
2.34.1
- [PULL 30/41] target/ppc: books: Machine Check exception cleanup, (continued)
- [PULL 30/41] target/ppc: books: Machine Check exception cleanup, Cédric Le Goater, 2022/01/31
- [PULL 05/41] ppc/pnv: use a do-while() loop in pnv_phb3_translate_tve(), Cédric Le Goater, 2022/01/31
- [PULL 16/41] target/ppc: Introduce powerpc_excp_40x, Cédric Le Goater, 2022/01/31
- [PULL 12/41] hw/ppc/vof: Add missing includes, Cédric Le Goater, 2022/01/31
- [PULL 38/41] target/ppc: 74xx: System Call exception cleanup, Cédric Le Goater, 2022/01/31
- [PULL 29/41] target/ppc: Simplify powerpc_excp_books, Cédric Le Goater, 2022/01/31
- [PULL 41/41] target/ppc: Remove support for the PowerPC 602 CPU, Cédric Le Goater, 2022/01/31
- [PULL 24/41] target/ppc: 405: Data Storage exception cleanup, Cédric Le Goater, 2022/01/31
- [PULL 40/41] target/ppc: 74xx: Set SRRs directly in exception code, Cédric Le Goater, 2022/01/31
- [PULL 07/41] ppc/xive: check return value of ldq_be_dma(), Cédric Le Goater, 2022/01/31
- [PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi,
Cédric Le Goater <=
- Re: [PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi, Cédric Le Goater, 2022/01/31
- Re: [PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi, Mark Cave-Ayland, 2022/01/31
[PULL 36/41] target/ppc: 74xx: External interrupt cleanup, Cédric Le Goater, 2022/01/31
[PULL 31/41] target/ppc: books: External interrupt cleanup, Cédric Le Goater, 2022/01/31
[PULL 28/41] target/ppc: Introduce powerpc_excp_books, Cédric Le Goater, 2022/01/31