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: <20231007203411.GA8085@noisy.programming.kicks-ass.net>
Date:   Sat, 7 Oct 2023 22:34:11 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Lucy Mielke <lucymielke@...oud.com>
Cc:     mingo@...hat.com, acme@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        namhyung@...nel.org, irogers@...gle.com, adrian.hunter@...el.com,
        tglx@...utronix.de, bp@...en8.de, dave.hansen@...ux.intel.com,
        x86@...nel.org, hpa@...or.com, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/x86/p4: Fix "Wunused-but-set-variable" warning

On Sat, Oct 07, 2023 at 08:55:19PM +0200, Lucy Mielke wrote:
> This fixes a compiler warning when compiling an allyesconfig with W=1:
> warning: variable ´high´ set but not used [-Wunused-but-set-variable]

What compiler and what .config?

> Signed-off-by: Lucy Mielke <lucymielke@...oud.com>
> ---
>  arch/x86/events/intel/p4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/events/intel/p4.c b/arch/x86/events/intel/p4.c
> index 35936188db01..69aaf7c0f340 100644
> --- a/arch/x86/events/intel/p4.c
> +++ b/arch/x86/events/intel/p4.c
> @@ -1366,7 +1366,7 @@ static __initconst const struct x86_pmu p4_pmu = {
>  
>  __init int p4_pmu_init(void)
>  {
> -	unsigned int low, high;
> +	unsigned int low, __maybe_unused high;
>  	int i, reg;
>  
>  	/* If we get stripped -- indexing fails */

Right after this we have:

	rdmsr(MSR_IA32_MISC_ENABLE, low, high);

which should get high unconditionally used. If there's a problem then
it's probably inside that rdmsr macro.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ