]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
target/ppc: Simplify checking for real mode in get_physical_address_wtlb()
authorBALATON Zoltan <balaton@eik.bme.hu>
Sun, 12 May 2024 23:27:37 +0000 (01:27 +0200)
committerNicholas Piggin <npiggin@gmail.com>
Thu, 23 May 2024 23:41:17 +0000 (09:41 +1000)
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.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
target/ppc/mmu_common.c

index 09cbeb0052c4080886bd73df1f4f908db176f39f..886fb6a65713e501ade59c7ec5e1b6afadead89b 100644 (file)
@@ -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: