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]
Message-ID: <20160426003912.GA26991@codeaurora.org>
Date:	Mon, 25 Apr 2016 19:39:12 -0500
From:	Richard Kuo <rkuo@...eaurora.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	torvalds@...ux-foundation.org, mingo@...nel.org,
	tglx@...utronix.de, will.deacon@....com,
	paulmck@...ux.vnet.ibm.com, boqun.feng@...il.com,
	waiman.long@....com, fweisbec@...il.com,
	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	rth@...ddle.net, vgupta@...opsys.com, linux@....linux.org.uk,
	egtvedt@...fundet.no, realmz6@...il.com,
	ysato@...rs.sourceforge.jp, tony.luck@...el.com,
	geert@...ux-m68k.org, james.hogan@...tec.com, ralf@...ux-mips.org,
	dhowells@...hat.com, jejb@...isc-linux.org, mpe@...erman.id.au,
	schwidefsky@...ibm.com, dalias@...c.org, davem@...emloft.net,
	cmetcalf@...lanox.com, jcmvbkbc@...il.com, arnd@...db.de,
	dbueso@...e.de, fengguang.wu@...el.com
Subject: Re: [RFC][PATCH 10/31] locking,hexagon: Implement
 atomic_fetch_{add,sub,and,or,xor}()

On Sat, Apr 23, 2016 at 04:16:58AM +0200, Peter Zijlstra wrote:
> On Fri, Apr 22, 2016 at 11:04:23AM +0200, Peter Zijlstra wrote:
> > +#define ATOMIC_FETCH_OP(op)						\
> > +static inline int atomic_fetch_##op(int i, atomic_t *v)			\
> > +{									\
> > +	int output, val;						\
> > +									\
> > +	__asm__ __volatile__ (						\
> > +		"1:	%0 = memw_locked(%2);\n"			\
> > +		"	%1 = "#op "(%0,%3);\n"				\
> > +		"	memw_locked(%2,P3)=%0;\n"			\
> 
> I'm thinking that wants to be:
> 
> 			memw_locked(%2,P3)=%1;
> 
> > +		"	if !P3 jump 1b;\n"				\
> > +		: "=&r" (output), "=&r" (val)				\
> > +		: "r" (&v->counter), "r" (i)				\
> > +		: "memory", "p3"					\
> > +	);								\
> > +	return output;							\
> > +}

I think you are right.  With the above fix,

Acked-by: Richard Kuo <rkuo@...eaurora.org>


-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ