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, 6 Jan 2007 23:26:41 -0800
From:	Andrew Morton <akpm@...l.org>
To:	Daniel Walker <dwalker@...sta.com>
Cc:	linux-kernel@...r.kernel.org, mm-commits@...r.kernel.org,
	kiran@...lex86.org, ak@...e.de, md@...gle.com, mingo@...e.hu,
	pravin.shelar@...softinc.com, shai@...lex86.org
Subject: Re: +
 spin_lock_irq-enable-interrupts-while-spinning-i386-implementation.patch
 added to -mm tree

On Sat, 06 Jan 2007 14:35:53 -0800
Daniel Walker <dwalker@...sta.com> wrote:

> On Wed, 2007-01-03 at 13:12 -0800, akpm@...l.org wrote:
> > -# define __raw_spin_lock_irq(lock) __raw_spin_lock(lock)
> > +
> > +static inline void __raw_spin_lock_irq(raw_spinlock_t *lock)
> > +{
> > +       asm volatile("\n1:\t"
> > +                    LOCK_PREFIX " ; decb %0\n\t"
> > +                    "jns 3f\n"
> > +                    STI_STRING "\n"
> > +                    "2:\t"
> > +                    "rep;nop\n\t"
> > +                    "cmpb $0,%0\n\t"
> > +                    "jle 2b\n\t"
> > +                    CLI_STRING "\n"
> > +                    "jmp 1b\n"
> > +                    "3:\n\t"
> > +                    : "+m" (lock->slock) : : "memory");
> > +}
> >  #endif
> >   
> 
> This doesn't compile when CONFIG_PARAVIRT is enabled. It changes the
> CLI_STRING and STI_STRING values.
> 


diff -puN include/asm-i386/spinlock.h~spin_lock_irq-enable-interrupts-while-spinning-i386-implementation-fix include/asm-i386/spinlock.h
--- a/include/asm-i386/spinlock.h~spin_lock_irq-enable-interrupts-while-spinning-i386-implementation-fix
+++ a/include/asm-i386/spinlock.h
@@ -86,17 +86,19 @@ static inline void __raw_spin_lock_flags
 static inline void __raw_spin_lock_irq(raw_spinlock_t *lock)
 {
 	asm volatile("\n1:\t"
-		     LOCK_PREFIX " ; decb %0\n\t"
+		     LOCK_PREFIX " ; decb %[slock]\n\t"
 		     "jns 3f\n"
 		     STI_STRING "\n"
 		     "2:\t"
 		     "rep;nop\n\t"
-		     "cmpb $0,%0\n\t"
+		     "cmpb $0,%[slock]\n\t"
 		     "jle 2b\n\t"
 		     CLI_STRING "\n"
 		     "jmp 1b\n"
 		     "3:\n\t"
-		     : "+m" (lock->slock) : : "memory");
+		     : [slock] "+m" (lock->slock)
+		     : __CLI_STI_INPUT_ARGS
+		     : "memory" CLI_STI_CLOBBERS);
 }
 #endif
 
diff -puN include/asm-i386/paravirt.h~spin_lock_irq-enable-interrupts-while-spinning-i386-implementation-fix include/asm-i386/paravirt.h
--- a/include/asm-i386/paravirt.h~spin_lock_irq-enable-interrupts-while-spinning-i386-implementation-fix
+++ a/include/asm-i386/paravirt.h
@@ -509,10 +509,10 @@ static inline unsigned long __raw_local_
 		     "popl %%edx; popl %%ecx",				\
 		     PARAVIRT_IRQ_ENABLE, CLBR_EAX)
 #define CLI_STI_CLOBBERS , "%eax"
-#define CLI_STI_INPUT_ARGS \
-	,								\
+#define __CLI_STI_INPUT_ARGS						\
 	[irq_disable] "i" (offsetof(struct paravirt_ops, irq_disable)),	\
 	[irq_enable] "i" (offsetof(struct paravirt_ops, irq_enable))
+#define CLI_STI_INPUT_ARGS , __CLI_STI_INPUT_ARGS
 
 #else  /* __ASSEMBLY__ */
 
_

-
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