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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 18 Feb 2010 19:25:19 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH hw_breakpoint] percpu: add __percpu sparse annotations
	to hw_breakpoint

On Thu, Feb 18, 2010 at 09:49:08AM +0900, Tejun Heo wrote:
> Hello,
> 
> On 02/18/2010 01:39 AM, Frederic Weisbecker wrote:
> > On Wed, Feb 17, 2010 at 10:50:50AM +0900, Tejun Heo wrote:
> > Yeah, looks good, I'm queuing it.
> > Just few comments below, for nano-considerations.
> >>  	cpu_events = alloc_percpu(typeof(*cpu_events));
> >>  	if (!cpu_events)
> >> -		return ERR_PTR(-ENOMEM);
> >> +		return (void __percpu __force *)ERR_PTR(-ENOMEM);
> > 
> > Is this pattern common enough that we can think about a ERR_CPU_PTR ?
> 
> I thought about that but there aren't too many yet, so I just added
> the ugly castings.  It would be cool if sparse can be taught that
> ERR_PTR() returns universal pseudo pointer.



Yeah, it would be nice to just have a universal address space
that is compatible with all others. It's sad to see such
uglification to make a secondary tool happy.

 
> >>  	sample_hbp = register_wide_hw_breakpoint(&attr, sample_hbp_handler);
> >> -	if (IS_ERR(sample_hbp)) {
> >> -		ret = PTR_ERR(sample_hbp);
> >> +	if (IS_ERR((void __force *)sample_hbp)) {
> >> +		ret = PTR_ERR((void __force *)sample_hbp);
> > 
> > Same comments here, although I wouldn't like much a CPU_PTR_ERR or
> > IS_ERR_CPU.... CPP is just so poor in magic for that.
> > 
> > I must confess I miss a bit the old per_cpu prefix that guarded the implicit
> > separate namespace.
> 
> Yeap, I agree that the prefix had its advantages.  It's just that it
> can't scale to the new situation where static and dynamic percpu
> variables behave uniformly.


Well, I miss a bit of per cpu internals so I won't argue further :)

Thanks.

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