[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/26] target/ppc: do not call hreg_compute_hflags() in helper_sto
From: |
Cédric Le Goater |
Subject: |
[PULL 26/26] target/ppc: do not call hreg_compute_hflags() in helper_store_mmcr0() |
Date: |
Tue, 4 Jan 2022 08:31:21 +0100 |
From: Daniel Henrique Barboza <danielhb413@gmail.com>
MMCR0 writes will change only MMCR0 bits which are used to calculate
HFLAGS_PMCC0, HFLAGS_PMCC1 and HFLAGS_INSN_CNT hflags. No other machine
register will be changed during this operation. This means that
hreg_compute_hflags() is overkill for what we need to do.
pmu_update_summaries() is already updating HFLAGS_INSN_CNT without
calling hreg_compure_hflags(). Let's do the same for the other 2 MMCR0
hflags.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220103224746.167831-5-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/power8-pmu.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/target/ppc/power8-pmu.c b/target/ppc/power8-pmu.c
index 73713ca2a320..236e8e66e966 100644
--- a/target/ppc/power8-pmu.c
+++ b/target/ppc/power8-pmu.c
@@ -224,12 +224,17 @@ static void pmu_update_overflow_timers(CPUPPCState *env)
void helper_store_mmcr0(CPUPPCState *env, target_ulong value)
{
+ bool hflags_pmcc0 = (value & MMCR0_PMCC0) != 0;
+ bool hflags_pmcc1 = (value & MMCR0_PMCC1) != 0;
+
pmu_update_cycles(env);
env->spr[SPR_POWER_MMCR0] = value;
/* MMCR0 writes can change HFLAGS_PMCC[01] and HFLAGS_INSN_CNT */
- hreg_compute_hflags(env);
+ env->hflags = deposit32(env->hflags, HFLAGS_PMCC0, 1, hflags_pmcc0);
+ env->hflags = deposit32(env->hflags, HFLAGS_PMCC1, 1, hflags_pmcc1);
+
pmu_update_summaries(env);
/* Update cycle overflow timers with the current MMCR0 state */
--
2.31.1
- [PULL 12/26] ppc/ppc405: Restore TCR and STR write handlers, (continued)
- [PULL 12/26] ppc/ppc405: Restore TCR and STR write handlers, Cédric Le Goater, 2022/01/04
- [PULL 10/26] ppc/ppc4xx: Convert printfs(), Cédric Le Goater, 2022/01/04
- [PULL 18/26] target/ppc: powerpc_excp: Set alternate SRRs directly, Cédric Le Goater, 2022/01/04
- [PULL 08/26] target/ppc: Remove static inline, Cédric Le Goater, 2022/01/04
- [PULL 09/26] target/ppc: Print out literal exception names in logs, Cédric Le Goater, 2022/01/04
- [PULL 02/26] ppc/pnv: Remove PHB4 reset handler, Cédric Le Goater, 2022/01/04
- [PULL 23/26] target/ppc: Cache per-pmc insn and cycle count settings, Cédric Le Goater, 2022/01/04
- [PULL 15/26] ppc/ppc405: Introduce a store helper for SPR_40x_PID, Cédric Le Goater, 2022/01/04
- [PULL 22/26] target/ppc: powerpc_excp: Stop passing excp_model around, Cédric Le Goater, 2022/01/04
- [PULL 03/26] ppc/pnv: Remove the PHB4 "device-id" property, Cédric Le Goater, 2022/01/04
- [PULL 26/26] target/ppc: do not call hreg_compute_hflags() in helper_store_mmcr0(),
Cédric Le Goater <=
- [PULL 25/26] target/ppc: Use env->pnc_cyc_cnt, Cédric Le Goater, 2022/01/04
- [PULL 01/26] ppc/pnv: Change the maximum of PHB3 devices for Power8NVL, Cédric Le Goater, 2022/01/04
- Re: [PULL 00/26] ppc queue, Richard Henderson, 2022/01/04