From: Harsh Prateek Bora Date: Thu, 10 Oct 2024 05:47:32 +0000 (+0530) Subject: target/ppc: use locally stored msr and avoid indirect access X-Git-Tag: v9.2.0-rc0~22^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bbddc08bc1d7046b58880454e3278530f825885;p=thirdparty%2Fqemu.git target/ppc: use locally stored msr and avoid indirect access hreg_compute_hflags_value already stores msr locally to be used in most of the logic in the routine however some instances are still using env->msr which is unnecessary. Use locally stored value as available. Reviewed-by: Nicholas Piggin Reviewed-by: BALATON Zoltan Signed-off-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin --- diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index 02076e96fbd..fe543ab3b89 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -143,10 +143,10 @@ static uint32_t hreg_compute_hflags_value(CPUPPCState *env) if (ppc_flags & POWERPC_FLAG_DE) { target_ulong dbcr0 = env->spr[SPR_BOOKE_DBCR0]; - if ((dbcr0 & DBCR0_ICMP) && FIELD_EX64(env->msr, MSR, DE)) { + if ((dbcr0 & DBCR0_ICMP) && FIELD_EX64(msr, MSR, DE)) { hflags |= 1 << HFLAGS_SE; } - if ((dbcr0 & DBCR0_BRT) && FIELD_EX64(env->msr, MSR, DE)) { + if ((dbcr0 & DBCR0_BRT) && FIELD_EX64(msr, MSR, DE)) { hflags |= 1 << HFLAGS_BE; } } else {