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]
Date:	Fri, 22 Jun 2012 18:36:43 +0200
From:	Robert Richter <robert.richter@....com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Ingo Molnar <mingo@...nel.org>,
	Stephane Eranian <eranian@...gle.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/4] perf, x86: Improve debug output in check_hw_exists()

On 22.06.12 17:53:47, Peter Zijlstra wrote:
> My gcc wants me to add the below to avoid used uninitialized warns:
> 
> ---
> --- a/arch/x86/kernel/cpu/perf_event.c
> +++ b/arch/x86/kernel/cpu/perf_event.c
> @@ -211,8 +211,9 @@ static bool check_hw_exists(void)
>  	 * that don't trap on the MSR access and always return 0s.
>  	 */
>  	val = 0xabcdUL;
> -	ret = wrmsrl_safe(x86_pmu_event_addr(0), val);
> -	ret |= rdmsrl_safe(x86_pmu_event_addr(0), &val_new);
> +	reg = x86_pmu_event_addr(0);
> +	ret = wrmsrl_safe(reg, val);
> +	ret |= rdmsrl_safe(reg, &val_new);

Yes, this is correct. It fixes also correct reporting of reg if it
fails here.

I wonder why my gcc this didn't report, its 4.4.5.

Thanks,

-Robert

-- 
Advanced Micro Devices, Inc.
Operating System Research Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists