diff mbox series

target/arm: Count PMU events when MDCR.SPME is set

Message ID 20200825144810.1755379-1-aaron@os.amperecomputing.com (mailing list archive)
State New, archived
Headers show
Series target/arm: Count PMU events when MDCR.SPME is set | expand

Commit Message

Aaron Lindsay Aug. 25, 2020, 2:48 p.m. UTC
This check was backwards when introduced in commit
033614c47de78409ad3fb39bb7bd1483b71c6789:

    target/arm: Filter cycle counter based on PMCCFILTR_EL0

Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com>
---
 target/arm/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell Sept. 11, 2020, 2:13 p.m. UTC | #1
On Tue, 25 Aug 2020 at 15:49, Aaron Lindsay
<aaron@os.amperecomputing.com> wrote:
>
> This check was backwards when introduced in commit
> 033614c47de78409ad3fb39bb7bd1483b71c6789:
>
>     target/arm: Filter cycle counter based on PMCCFILTR_EL0
>
> Signed-off-by: Aaron Lindsay <aaron@os.amperecomputing.com>
> ---
>  target/arm/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index 6b4f0eb533..8e7730c7e3 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -1452,7 +1452,7 @@ static bool pmu_counter_enabled(CPUARMState *env, uint8_t counter)
>          }
>      } else {
>          prohibited = arm_feature(env, ARM_FEATURE_EL3) &&
> -           (env->cp15.mdcr_el3 & MDCR_SPME);
> +           !(env->cp15.mdcr_el3 & MDCR_SPME);
>      }
>
>      if (prohibited && counter == 31) {



Applied to target-arm.next, thanks.

-- PMM
diff mbox series

Patch

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 6b4f0eb533..8e7730c7e3 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -1452,7 +1452,7 @@  static bool pmu_counter_enabled(CPUARMState *env, uint8_t counter)
         }
     } else {
         prohibited = arm_feature(env, ARM_FEATURE_EL3) &&
-           (env->cp15.mdcr_el3 & MDCR_SPME);
+           !(env->cp15.mdcr_el3 & MDCR_SPME);
     }
 
     if (prohibited && counter == 31) {