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] [day] [month] [year] [list]
Date:	Wed, 10 Jun 2015 18:00:00 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Ralf Baechle <ralf@...ux-mips.org>
Cc:	Xose Vazquez Perez <xose.vazquez@...il.com>,
	linux-arch@...r.kernel.org, linux-mips@...ux-mips.org,
	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>
Subject: Re: HAVE_CMPXCHG_LOCAL arch support.

On Wed, 2015-06-10 at 17:57 +0200, Ralf Baechle wrote:
> On Wed, Jun 10, 2015 at 04:58:04PM +0200, Ralf Baechle wrote:
> 
> > On Mon, Jun 08, 2015 at 03:14:43PM +0200, Xose Vazquez Perez wrote:
> > 
> > > If there is anything wrong, please report it in this thread:
> > > https://marc.info/?t=143332955700003
> > 
> > 
> > >    locking/ cmpxchg-local        : TODO |                  HAVE_CMPXCHG_LOCAL #  arch supports the this_cpu_cmpxchg() API
> > 
> > This one was easy - we have the functions in the code just no "select
> > HAVE_CMPXCHG_LOCAL" Kconfig.
> 
> Something's wrong there.  The new file
> Documentation/features/locking/cmpxchg-local/arch-support.txt in linux-next
> claims correctly that only s390 and x86 define HAVE_CMPXCHG_LOCAL.  And a
> git grep -w cmpxchg_local finds that in addition to these alpha, arm, arm64,
> avr32, blackfin, c6x, frv, ia64, m32r, m68k, mips, parisc, powerpc, sparc,
> unicore32 and xtensa define cmpxchg_local.
> 
> These architectures seem to not define cmpxchg_local in their arch/ dir:
> 
>   arc cris hexagon metag microblaze mn10300 nios2 openrisc score sh tile um
> 
> Microblaze and nios2 include <asm-generic/cmpxchg.h> into their arch
> cmpxchg.h so they get a definition of these functions but don't define
> HAVE_CMPXCHG_LOCAL.  Peter Zijlstra said it the local versions are ~ 20
> cycles faster on x86 than the "global" version.  But I've found one user
> of cmpxchg_local, mm/vmstat.c and one user of cmpxchg64_local,
> drivers/iommu/intel-iommu.c.  Sure, fixing the issue was trivial for me
> on MIPS but is having cmpxchg{,64}_local actually worth it?  

If you traverse the obfuscation chain a little, you'll find that
local_cmpxchg() is implemented using cmpxchg_local(), and there are a
few more users of that.
--
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