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

Aaron Lindsay posted 1 patch 3 years, 8 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200825144810.1755379-1-aaron@os.amperecomputing.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] target/arm: Count PMU events when MDCR.SPME is set
Posted by Aaron Lindsay 3 years, 8 months ago
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) {
-- 
2.17.1


Re: [PATCH] target/arm: Count PMU events when MDCR.SPME is set
Posted by Peter Maydell 3 years, 7 months ago
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