[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 04/32] target/ppc/mmu_common.c: Simplify checking for real mod
From: |
BALATON Zoltan |
Subject: |
[PATCH v5 04/32] target/ppc/mmu_common.c: Simplify checking for real mode |
Date: |
Thu, 09 May 2024 22:25:37 +0200 (CEST) |
In get_physical_address_wtlb() the real_mode flag depends on either
the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the
needed bit in a more straight forward way instead of doing unnecessary
computation.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
---
target/ppc/mmu_common.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c
index 09cbeb0052..886fb6a657 100644
--- a/target/ppc/mmu_common.c
+++ b/target/ppc/mmu_common.c
@@ -1184,8 +1184,10 @@ int get_physical_address_wtlb(CPUPPCState *env,
mmu_ctx_t *ctx,
int mmu_idx)
{
int ret = -1;
- bool real_mode = (type == ACCESS_CODE && !FIELD_EX64(env->msr, MSR, IR)) ||
- (type != ACCESS_CODE && !FIELD_EX64(env->msr, MSR, DR));
+ bool real_mode;
+
+ real_mode = (type == ACCESS_CODE) ? !FIELD_EX64(env->msr, MSR, IR)
+ : !FIELD_EX64(env->msr, MSR, DR);
switch (env->mmu_model) {
case POWERPC_MMU_SOFT_6xx:
--
2.30.9
- [PATCH v5 00/32] Misc PPC exception and BookE MMU clean ups, BALATON Zoltan, 2024/05/09
- [PATCH v5 02/32] target/ppc/mmu_common.c: Move calculation of a value closer to its usage, BALATON Zoltan, 2024/05/09
- [PATCH v5 04/32] target/ppc/mmu_common.c: Simplify checking for real mode,
BALATON Zoltan <=
- [PATCH v5 03/32] target/ppc/mmu_common.c: Remove unneeded local variable, BALATON Zoltan, 2024/05/09
- [PATCH v5 01/32] target/ppc: Remove unused helper, BALATON Zoltan, 2024/05/09
- [PATCH v5 08/32] target/ppc/mmu_common.c: Move some debug logging, BALATON Zoltan, 2024/05/09
- [PATCH v5 07/32] target/ppc/mmu_common.c: Move else branch to avoid large if block, BALATON Zoltan, 2024/05/09
- [PATCH v5 10/32] target/ppc/mmu_common.c: Split out BookE cases before checking real mode, BALATON Zoltan, 2024/05/09
- [PATCH v5 06/32] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address(), BALATON Zoltan, 2024/05/09
- [PATCH v5 12/32] target/ppc/mmu_common.c: Inline and remove check_physical(), BALATON Zoltan, 2024/05/09
- [PATCH v5 18/32] target/ppc/mmu_common.c: Don't use mmu_ctx_t in mmubooke206_get_physical_address(), BALATON Zoltan, 2024/05/09
- [PATCH v5 22/32] target/ppc/mmu_common.c: Eliminate get_physical_address_wtlb(), BALATON Zoltan, 2024/05/09
- [PATCH v5 14/32] target/ppc/mmu_common.c: Deindent ppc_jumbo_xlate(), BALATON Zoltan, 2024/05/09