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:	Wed, 30 Sep 2009 17:31:02 +0200
From:	Arjan van de Ven <arjan@...radead.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	John Stultz <johnstul@...ibm.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...e.hu>
Subject: Re: Linux 2.6.32-rc1

On Wed, 30 Sep 2009 17:27:05 +0200
Eric Dumazet <eric.dumazet@...il.com> wrote:
> 
> > +	pop %edi
> Why do you pop flags in edi, to later re-push them ?
> 
> > +	cli

because here I disable interrupts

(basically this is local_irq_save() )
> 
> 
> > +	xchg (%esi), %ebx
> > +	xchg 4(%esi), %ecx
> How this sequence is guaranteed to be atomic with other cpus ?

it is not. this is the 486 implementation which is !SMP
(just like the current cmpxchg64() fallback)

> 
> If it is a !SMP implementation, then you could replace xchg by mov
> instructions.

that is not equivalent. I need to also store the old values
and return them....


> 
> So I suggest :
> 
> 
> ENTRY(cmpxchg8b_emu)
> 	CFI_STARTPROC
> 
> 	/* disable interrupts */
> 	pushf
> 	cli
> 
> 	cmpl  %eax,(%esi)
> 	jne   1f
> 	cmpl  %edx,4(%esi)
> 	jne   2f
> 
> 	mov   %ebx,(%esi)
> 	mov   %ecx,4(%esi)

this is not equivalent since you don't return the "prev" value.



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
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