[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 07/33] target/ppc/mmu_common.c: Simplify checking for real mod
From: |
BALATON Zoltan |
Subject: |
[PATCH v4 07/33] target/ppc/mmu_common.c: Simplify checking for real mode |
Date: |
Thu, 09 May 2024 01:36:10 +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 v4 00/33] Misc PPC exception and BookE MMU clean ups, BALATON Zoltan, 2024/05/08
- [PATCH v4 01/33] target/ppc: Fix gen_sc to use correct nip, BALATON Zoltan, 2024/05/08
- [PATCH v4 03/33] target/ppc: Simplify syscall exception handlers, BALATON Zoltan, 2024/05/08
- [PATCH v4 06/33] target/ppc/mmu_common.c: Remove unneeded local variable, BALATON Zoltan, 2024/05/08
- [PATCH v4 02/33] target/ppc: Move patching nip from exception handler to helper_scv, BALATON Zoltan, 2024/05/08
- [PATCH v4 04/33] target/ppc: Remove unused helper, BALATON Zoltan, 2024/05/08
- [PATCH v4 05/33] target/ppc/mmu_common.c: Move calculation of a value closer to its usage, BALATON Zoltan, 2024/05/08
- [PATCH v4 07/33] target/ppc/mmu_common.c: Simplify checking for real mode,
BALATON Zoltan <=
- [PATCH v4 08/33] target/ppc/mmu_common.c: Drop cases for unimplemented MPC8xx MMU, BALATON Zoltan, 2024/05/08
- [PATCH v4 09/33] target/ppc/mmu_common.c: Introduce mmu6xx_get_physical_address(), BALATON Zoltan, 2024/05/08
- [PATCH v4 10/33] target/ppc/mmu_common.c: Move else branch to avoid large if block, BALATON Zoltan, 2024/05/08
- [PATCH v4 11/33] target/ppc/mmu_common.c: Move some debug logging, BALATON Zoltan, 2024/05/08
- [PATCH v4 13/33] target/ppc/mmu_common.c: Split out BookE cases before checking real mode, BALATON Zoltan, 2024/05/08
- [PATCH v4 12/33] target/ppc/mmu_common.c: Eliminate ret from mmu6xx_get_physical_address(), BALATON Zoltan, 2024/05/08
- [PATCH v4 14/33] target/ppc/mmu_common.c: Split off real mode cases in get_physical_address_wtlb(), BALATON Zoltan, 2024/05/08
- [PATCH v4 15/33] target/ppc/mmu_common.c: Inline and remove check_physical(), BALATON Zoltan, 2024/05/08