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: <CAJvTdKm9axkp+E13irUPFhE1iPmUJOM3oji1Gfbt8b=FnifmRQ@mail.gmail.com>
Date:	Sun, 13 Mar 2016 03:28:17 -0400
From:	Len Brown <lenb@...nel.org>
To:	Chen Yu <yu.c.chen@...el.com>
Cc:	"Brown, Len" <len.brown@...el.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	"Pandruvada, Srinivas" <srinivas.pandruvada@...el.com>,
	"Zhang, Rui" <rui.zhang@...el.com>,
	Linux PM list <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] tools/power turbostat: bugfix: fix several invalid parameters

Thanks for the patch Yu.

As it turns out, I already had a fix for this in my tree.
I think the compiler complained about these programming errors
when I compiled on a machine different from my standard desktop.

If you know what compiler options cause it to check
for stuff like this by default, I'd welcome a patch to the Makefile to
enable them.

thanks,
-Len


On Sun, Dec 13, 2015 at 8:09 AM, Chen Yu <yu.c.chen@...el.com> wrote:
> dump_cstate_pstate_config_info is invoked with no parameters,
> which might cause this function to misjudge the processor family
> and model. Fix this by passing family and model to it.
>
> Besides, fix the compiling warning caused by missing type declaration
> in dump_cstate_pstate_config_info, get_tdp and perf_limit_reasons_probe:
>
> turbostat.c: In function ‘dump_cstate_pstate_config_info’:
> turbostat.c:1973:1: warning: type of ‘family’ defaults to ‘int’ [-Wimplicit-int]
>  dump_cstate_pstate_config_info(family, model)
>  ^
> turbostat.c:1973:1: warning: type of ‘model’ defaults to ‘int’ [-Wimplicit-int]
> turbostat.c: In function ‘get_tdp’:
> turbostat.c:2145:8: warning: type of ‘model’ defaults to ‘int’ [-Wimplicit-int]
>  double get_tdp(model)
>         ^
> turbostat.c: In function ‘perf_limit_reasons_probe’:
> turbostat.c:2259:6: warning: type of ‘family’ defaults to ‘int’ [-Wimplicit-int]
>  void perf_limit_reasons_probe(family, model)
>       ^
> turbostat.c:2259:6: warning: type of ‘model’ defaults to ‘int’ [-Wimplicit-int]
>
> Signed-off-by: Chen Yu <yu.c.chen@...el.com>
> ---
>  tools/power/x86/turbostat/turbostat.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
> index 9854929..47068de 100644
> --- a/tools/power/x86/turbostat/turbostat.c
> +++ b/tools/power/x86/turbostat/turbostat.c
> @@ -1970,7 +1970,7 @@ int has_config_tdp(unsigned int family, unsigned int model)
>  }
>
>  static void
> -dump_cstate_pstate_config_info(family, model)
> +dump_cstate_pstate_config_info(unsigned int family, unsigned int model)
>  {
>         if (!do_nhm_platform_info)
>                 return;
> @@ -2142,7 +2142,7 @@ int print_perf_limit(struct thread_data *t, struct core_data *c, struct pkg_data
>  #define        RAPL_POWER_GRANULARITY  0x7FFF  /* 15 bit power granularity */
>  #define        RAPL_TIME_GRANULARITY   0x3F /* 6 bit time granularity */
>
> -double get_tdp(model)
> +double get_tdp(unsigned int model)
>  {
>         unsigned long long msr;
>
> @@ -2256,7 +2256,7 @@ void rapl_probe(unsigned int family, unsigned int model)
>         return;
>  }
>
> -void perf_limit_reasons_probe(family, model)
> +void perf_limit_reasons_probe(unsigned int family, unsigned int model)
>  {
>         if (!genuine_intel)
>                 return;
> @@ -2792,7 +2792,7 @@ void process_cpuid()
>         perf_limit_reasons_probe(family, model);
>
>         if (debug)
> -               dump_cstate_pstate_config_info();
> +               dump_cstate_pstate_config_info(family, model);
>
>         if (has_skl_msrs(family, model))
>                 calculate_tsc_tweak();
> --
> 1.8.4.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Len Brown, Intel Open Source Technology Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ