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:	Tue, 14 Apr 2009 09:45:56 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Al Viro <viro@...IV.linux.org.uk>, Ingo Molnar <mingo@...e.hu>,
	Tejun Heo <tj@...nel.org>, Mike Travis <travis@....com>,
	Christoph Lameter <cl@...ux-foundation.org>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Ivan Kokshaysky <ink@...assic.park.msu.ru>
Subject: Re: [PATCH] unbreak alpha percpu

On Fri, 10 Apr 2009 09:21:08 -0700 (PDT)
Linus Torvalds <torvalds@...ux-foundation.org> wrote:

> 
> Hmm. I certainly personally _much_ prefer this version.
> 
> It looks like this actually simplifies things for S390 too (no more 
> simple_identifier_##var games), and generally just looks better. And 
> seeing that the S390 special case is no longer S390-specific is also a 
> good sign, imho.
> 
> Sorry for including the whole message, but I'm adding s390 and percpu 
> people to the cc. Guys - original uncorrupted patch on lkml.
> > diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h
> > index 408d60b..6a71d73 100644
> > --- a/arch/s390/include/asm/percpu.h
> > +++ b/arch/s390/include/asm/percpu.h
> > @@ -13,20 +13,18 @@
> >   */
> >  #if defined(__s390x__) && defined(MODULE)
> >  
> > -#define SHIFT_PERCPU_PTR(ptr,offset) (({			\
> > -	extern int simple_identifier_##var(void);	\
> > +#define SHIFT_PERCPU_PTR(var,offset) (({			\
> >  	unsigned long *__ptr;				\
> >  	asm ( "larl %0, %1@...ENT"		\
> > -	    : "=a" (__ptr) : "X" (ptr) );		\
> > -	(typeof(ptr))((*__ptr) + (offset));	}))
> > +	    : "=a" (__ptr) : "X" (&per_cpu_var(var)) );		\
> > +	(typeof(&per_cpu_var(var)))((*__ptr) + (offset));	}))
> >  
> >  #else
> >  
> > -#define SHIFT_PERCPU_PTR(ptr, offset) (({				\
> > -	extern int simple_identifier_##var(void);		\
> > +#define SHIFT_PERCPU_PTR(var, offset) (({				\
> >  	unsigned long __ptr;					\
> > -	asm ( "" : "=a" (__ptr) : "0" (ptr) );			\
> > -	(typeof(ptr)) (__ptr + (offset)); }))
> > +	asm ( "" : "=a" (__ptr) : "0" (&per_cpu_var(var)) );			\
> > +	(typeof(&per_cpu_var(var))) (__ptr + (offset)); }))
> >  
> >  #endif
> >  

I would like to get rid of that SHIFT_PERCPU_PTR mess. The patch from
Ivan will allow this, it uses a dummy variable to void the effect of a
static modifier for percpu variables in modules. The percpu variable
itself will be defined non-static, my gut feeling is that this is a
dirty little trick that might bite us in the future.
Another solution which I personally would prefer is to ban the use of
static percpu variables. Then the compiler will use the GOT to get the
address of percpu variables without any dirty tricks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

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