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: <20220506141213.GA23485@willie-the-truck>
Date:   Fri, 6 May 2022 15:12:14 +0100
From:   Will Deacon <will@...nel.org>
To:     Srinivasarao Pathipati <quic_c_spathi@...cinc.com>
Cc:     mark.rutland@....com, peterz@...radead.org, mingo@...hat.com,
        acme@...nel.org, alexander.shishkin@...ux.intel.com,
        jolsa@...nel.org, namhyung@...nel.org, catalin.marinas@....com,
        linux-arm-kernel@...ts.infradead.org,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] arm64: perf: Retain PMCR.X of PMCR_EL0 during reset

On Fri, Apr 29, 2022 at 04:59:09PM +0530, Srinivasarao Pathipati wrote:
> Preserve the bit PMCR.X of PMCR_EL0 during PMU reset to export
> PMU events. as it could be set before PMU initialization.
> 
> Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@...cinc.com>
> ---
> Changes since V1:
> 	- Preserving only PMCR_X bit as per Robin Murphy's comment
> ---
>  arch/arm64/kernel/perf_event.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
> index cb69ff1..532a417 100644
> --- a/arch/arm64/kernel/perf_event.c
> +++ b/arch/arm64/kernel/perf_event.c
> @@ -1047,6 +1047,9 @@ static void armv8pmu_reset(void *info)
>  	if (armv8pmu_has_long_event(cpu_pmu))
>  		pmcr |= ARMV8_PMU_PMCR_LP;
>  
> +	/* Preserve PMCR_X to export PMU events */
> +	pmcr |= (armv8pmu_pmcr_read() & ARMV8_PMU_PMCR_X);

I don't think this should be unconditional. Exporting events could easily
result in additional power consumption, and potentially even hardware
lockups.

Please stick this behind something like a sysctl toggle or sysfs control,
with documentation about what it does. It should default to disabled.

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ