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]
Message-Id: <20090921130941.e68c4bdb.akpm@linux-foundation.org>
Date:	Mon, 21 Sep 2009 13:09:41 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	kilroyd@...glemail.com, a.p.zijlstra@...llo.nl,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 1/2] spinlocks: check spinlock_t/rwlock_t argument type
 on non-SMP builds

On Mon, 21 Sep 2009 09:43:52 +0200
Ingo Molnar <mingo@...e.hu> wrote:

> 
> * akpm@...ux-foundation.org <akpm@...ux-foundation.org> wrote:
> 
> > From: David Kilroy <kilroyd@...glemail.com>
> > 
> > When writing code for UP without CONFIG_DEBUG_SPINLOCK it's easy to get
> > the first argument to the spinlock/rwlock functions wrong.  This is
> > because the parameter is not actually used in this configuration.
> > 
> > Typically you will only find out it's wrong
> >  * by rebuilding with CONFIG_SMP or CONFIG_DEBUG_SPINLOCK
> >  * after you've submitted your beautiful patch series.
> > 
> > The first means a long wait, and the latter is a bit late.
> > 
> > Change the intermediate macros into inline functions.
> > 
> > Signed-off-by: David Kilroy <kilroyd@...glemail.com>
> > Cc: Ingo Molnar <mingo@...e.hu>
> > Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> > Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> > ---
> > 
> >  include/linux/spinlock.h        |    6 -
> >  include/linux/spinlock_api_up.h |  118 ++++++++++++++++++++++--------
> >  2 files changed, 92 insertions(+), 32 deletions(-)
> > 
> > diff -puN include/linux/spinlock.h~spinlocks-check-spinlock_t-rwlock_t-argument-type-on-non-smp-builds include/linux/spinlock.h
> > --- a/include/linux/spinlock.h~spinlocks-check-spinlock_t-rwlock_t-argument-type-on-non-smp-builds
> > +++ a/include/linux/spinlock.h
> > @@ -240,17 +240,17 @@ static inline void smp_mb__after_lock(vo
> >  #define spin_lock_irqsave(lock, flags)			\
> >  	do {						\
> >  		typecheck(unsigned long, flags);	\
> > -		_spin_lock_irqsave(lock, flags);	\
> > +		_spin_lock_irqsave(lock, &flags);	\
> >  	} while (0)
> >  #define read_lock_irqsave(lock, flags)			\
> >  	do {						\
> >  		typecheck(unsigned long, flags);	\
> > -		_read_lock_irqsave(lock, flags);	\
> > +		_read_lock_irqsave(lock, &flags);	\
> >  	} while (0)
> 
> these bits broke the Alpha build:
> 
> /home/mingo/tip/arch/alpha/include/asm/core_t2.h: In function 't2_readb':
> /home/mingo/tip/arch/alpha/include/asm/core_t2.h:451: error: '_spin_lock_irqsave' is static but used in inline function 't2_readb' which is not static

hm.  What the heck does that mean?

__EXTERN_INLINE u8 t2_readb(const volatile void __iomem *xaddr)

Something to do with the extern-inline?


Do you have the .config?  My alpha builds went OK.



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