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: <CAJvTdKmt+3i+TjbYSa--=uS22q1ZgEQuferNhCxKVK_G5Lx2jQ@mail.gmail.com>
Date: Tue, 25 Nov 2025 14:14:21 -0500
From: Len Brown <lenb@...nel.org>
To: David Arcari <darcari@...hat.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] tools/power turbostat: allow turbostat to work when
 aperf is not available

It would be helpful if you could describe exactly what environment you
are running in.

are there any MSRs?
Is APERF available via perf, but not via MSR?
etc.

On Tue, Nov 18, 2025 at 10:58 AM David Arcari <darcari@...hat.com> wrote:
>
> Currently when aperf is not available the function has_amperf() still
> returns true.  The end result is that the program gets an error in
> delta_thread() which causes turbostat to restart.  We can avoid this
> by not setting msr_counter_arch_infos[MSR_ARCH_INFO_APERF_INDEX].present
> when aperf is not available allowing turbostat to execute normally.
>
> Signed-off-by: David Arcari <darcari@...hat.com>
> Cc: Len Brown <lenb@...nel.org>
> Cc: linux-kernel@...r.kernel.org
> ---
>  tools/power/x86/turbostat/turbostat.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index 5567b9ecd516..b3f1e4ae5813 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -8592,6 +8592,10 @@ void msr_perf_init_(void)
>                                 continue;
>
>                         if (cai->needed) {
> +                               /* check to see if APERF is available */
> +                               if (cidx == MSR_ARCH_INFO_APERF_INDEX && !has_aperf)
> +                                       continue;
> +
>                                 /* Use perf API for this counter */
>                                 if (add_msr_perf_counter(cpu, cci, cai) != -1) {
>                                         cci->source[cai->rci_index] = COUNTER_SOURCE_PERF;
> --
> 2.51.0
>
>


-- 
Len Brown, Intel Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ