lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240801112923.GA4476@willie-the-truck>
Date: Thu, 1 Aug 2024 12:29:24 +0100
From: Will Deacon <will@...nel.org>
To: "Rob Herring (Arm)" <robh@...nel.org>, catalin.marinas@....com
Cc: Mark Rutland <mark.rutland@....com>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf: arm_pmuv3: Fix chained event check for cycle
 counter

On Wed, Jul 10, 2024 at 12:23:56PM -0600, Rob Herring (Arm) wrote:
> Since commit b7e89b0f5bd7 ("perf: arm_pmu: Remove event index to
> counter remapping"), armv8pmu_event_is_chained() is incorrectly
> returning that the cycle counter is chained, but the cycle counter has
> always been 64-bit. The result is trying to configure counter #30 which
> typically doesn't exist.
> 
> As ARMV8_PMU_MAX_GENERAL_COUNTERS is the number of counters (31), the
> comparison to the counter index needs to be '<' rather than '<='.
> 
> Fixes: b7e89b0f5bd7 ("perf: arm_pmu: Remove event index to counter remapping")
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> ---
>  drivers/perf/arm_pmuv3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c
> index 3b3a3334cc3f..0e22c68fb804 100644
> --- a/drivers/perf/arm_pmuv3.c
> +++ b/drivers/perf/arm_pmuv3.c
> @@ -482,7 +482,7 @@ static bool armv8pmu_event_is_chained(struct perf_event *event)
>  	return !armv8pmu_event_has_user_read(event) &&
>  	       armv8pmu_event_is_64bit(event) &&
>  	       !armv8pmu_has_long_event(cpu_pmu) &&
> -	       (idx <= ARMV8_PMU_MAX_GENERAL_COUNTERS);
> +	       (idx < ARMV8_PMU_MAX_GENERAL_COUNTERS);
>  }

Acked-by: Will Deacon <will@...nel.org>

Catalin -- please can you pick this up as a fix?

Cheers,

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ