[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 6/8] target/ppc: Use ppc_interrupts_little_endian in powerpc_e
From: |
Fabiano Rosas |
Subject: |
[PATCH v3 6/8] target/ppc: Use ppc_interrupts_little_endian in powerpc_excp |
Date: |
Fri, 7 Jan 2022 19:25:59 -0300 |
The ppc_interrupts_little_endian function is now suitable for
determining the endianness of interrupts for all CPUs.
Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
---
target/ppc/excp_helper.c | 29 +----------------------------
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 3a430f23d6..3b4123bc65 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -832,36 +832,9 @@ static void powerpc_excp(PowerPCCPU *cpu, int excp)
* Sort out endianness of interrupt, this differs depending on the
* CPU, the HV mode, etc...
*/
-#ifdef TARGET_PPC64
- if (excp_model == POWERPC_EXCP_POWER7) {
- if (!(new_msr & MSR_HVB) && (env->spr[SPR_LPCR] & LPCR_ILE)) {
- new_msr |= (target_ulong)1 << MSR_LE;
- }
- } else if (excp_model == POWERPC_EXCP_POWER8) {
- if (new_msr & MSR_HVB) {
- if (env->spr[SPR_HID0] & HID0_HILE) {
- new_msr |= (target_ulong)1 << MSR_LE;
- }
- } else if (env->spr[SPR_LPCR] & LPCR_ILE) {
- new_msr |= (target_ulong)1 << MSR_LE;
- }
- } else if (excp_model == POWERPC_EXCP_POWER9 ||
- excp_model == POWERPC_EXCP_POWER10) {
- if (new_msr & MSR_HVB) {
- if (env->spr[SPR_HID0] & HID0_POWER9_HILE) {
- new_msr |= (target_ulong)1 << MSR_LE;
- }
- } else if (env->spr[SPR_LPCR] & LPCR_ILE) {
- new_msr |= (target_ulong)1 << MSR_LE;
- }
- } else if (msr_ile) {
+ if (ppc_interrupts_little_endian(cpu, !!(new_msr & MSR_HVB))) {
new_msr |= (target_ulong)1 << MSR_LE;
}
-#else
- if (msr_ile) {
- new_msr |= (target_ulong)1 << MSR_LE;
- }
-#endif
#if defined(TARGET_PPC64)
if (excp_model == POWERPC_EXCP_BOOKE) {
--
2.33.1
- [PATCH v3 0/8] target/ppc: powerpc_excp improvements (2/n), Fabiano Rosas, 2022/01/07
- [PATCH v3 2/8] target/ppc: powerpc_excp: Keep 60x/7x5 soft MMU logs active, Fabiano Rosas, 2022/01/07
- [PATCH v3 3/8] target/ppc: powerpc_excp: Group unimplemented exceptions, Fabiano Rosas, 2022/01/07
- [PATCH v3 4/8] target/ppc: Add HV support to ppc_interrupts_little_endian, Fabiano Rosas, 2022/01/07
- [PATCH v3 5/8] target/ppc: Add MSR_ILE support to ppc_interrupts_little_endian, Fabiano Rosas, 2022/01/07
- [PATCH v3 7/8] target/ppc: Introduce a wrapper for powerpc_excp, Fabiano Rosas, 2022/01/07
- [PATCH v3 1/8] target/ppc: powerpc_excp: Extract software TLB logging into a function, Fabiano Rosas, 2022/01/07
- [PATCH v3 6/8] target/ppc: Use ppc_interrupts_little_endian in powerpc_excp,
Fabiano Rosas <=
- [PATCH v3 8/8] target/ppc: Set the correct endianness for powernv memory dumps, Fabiano Rosas, 2022/01/07
- Re: [PATCH v3 0/8] target/ppc: powerpc_excp improvements (2/n), Cédric Le Goater, 2022/01/10