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:	Sat, 27 Dec 2008 15:07:06 +0900 (JST)
From:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	kosaki.motohiro@...fujitsu.com, Sam Ravnborg <sam@...nborg.org>,
	David Howells <dhowells@...hat.com>, mingo@...e.hu,
	Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	mel@....ul.ie
Subject: Re: [PATCH] perf_counter: more barrier in blank weak function

> 
> Impact: fix panic possible panic etc
> 
> some compiler seems to inline the weak global function if no line in it
> 
> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
> 
> diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
> index d7a79f3..37f7716 100644
> --- a/kernel/perf_counter.c
> +++ b/kernel/perf_counter.c
> @@ -45,8 +45,8 @@ hw_perf_counter_init(struct perf_counter *counter)
>  }
>  
>  u64 __weak hw_perf_save_disable(void)		{ return 0; }
> -void __weak hw_perf_restore(u64 ctrl)		{ }
> -void __weak hw_perf_counter_setup(void)		{ }
> +void __weak hw_perf_restore(u64 ctrl)		{ barrier(); }
> +void __weak hw_perf_counter_setup(void)		{ barrier(); }

We need comment into the function.
I expect anyone think "hm, this barrier() is meaningless. let's cleanup." in the future.
we should avoid it.



--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ