|
From: | Richard Henderson |
Subject: | Re: [PATCH 08/10] target/arm: Implement FEAT_PMUv3p5 cycle counter disable bits |
Date: | Sat, 20 Aug 2022 10:33:37 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 8/11/22 10:16, Peter Maydell wrote:
FEAT_PMUv3p5 introduces new bits MDCR_EL2.HCCD and MDCR_EL3.SCCD, which disable the cycle counter from counting at EL2 and EL3. Add the code to support these bits.
While HCCD is v3p5, it seems MCCD (typo above) is v3p7.
+ if (counter == 31) { + /* + * The cycle counter defaults to running. PMCR.DP says "disable + * the cycle counter when event counting is prohibited". + * Some MDCR bits disable the cycle counter specifically. + */ + prohibited = prohibited && env->cp15.c9_pmcr & PMCRDP; + if (cpu_isar_feature(any_pmuv3p5, env_archcpu(env))) { + if (el == 3) { + prohibited = prohibited || (env->cp15.mdcr_el3 & MDCR_MCCD); + } else if (el == 2) { + prohibited = prohibited || (mdcr_el2 & MDCR_HCCD); + }
But modulo the feature test, the behaviour looks right. r~
[Prev in Thread] | Current Thread | [Next in Thread] |