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: <lsq.1407170912.728427849@decadent.org.uk>
Date:	Mon, 04 Aug 2014 17:48:32 +0100
From:	Ben Hutchings <ben@...adent.org.uk>
To:	linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC:	akpm@...ux-foundation.org,
	"John David Anglin" <dave.anglin@...l.net>,
	"Benjamin Herrenschmidt" <benh@...nel.crashing.org>,
	"Russell King" <linux@....linux.org.uk>,
	"Paul McKenney" <paulmck@...ux.vnet.ibm.com>,
	"Mikulas Patocka" <mpatocka@...hat.com>,
	"Catalin Marinas" <catalin.marinas@....com>,
	"Waiman Long" <waiman.long@...com>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	linux-arm-kernel@...ts.infradead.org,
	"James E.J. Bottomley" <jejb@...isc-linux.org>,
	"Davidlohr Bueso" <davidlohr@...com>,
	"Vineet Gupta" <vgupta@...opsys.com>,
	"Will Deacon" <will.deacon@....com>,
	"Chris Metcalf" <cmetcalf@...era.com>,
	"David Miller" <davem@...emloft.net>,
	"James Hogan" <james.hogan@...tec.com>,
	"James Bottomley" <James.Bottomley@...senpartnership.com>,
	"Peter Zijlstra" <peterz@...radead.org>,
	"Ingo Molnar" <mingo@...nel.org>, linuxppc-dev@...ts.ozlabs.org,
	sparclinux@...r.kernel.org, "Jason Low" <jason.low2@...com>
Subject: [PATCH 3.2 51/94] locking/mutex: Disable optimistic spinning on
 some architectures

3.2.62-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Peter Zijlstra <peterz@...radead.org>

commit 4badad352a6bb202ec68afa7a574c0bb961e5ebc upstream.

The optimistic spin code assumes regular stores and cmpxchg() play nice;
this is found to not be true for at least: parisc, sparc32, tile32,
metag-lock1, arc-!llsc and hexagon.

There is further wreckage, but this in particular seemed easy to
trigger, so blacklist this.

Opt in for known good archs.

Signed-off-by: Peter Zijlstra <peterz@...radead.org>
Reported-by: Mikulas Patocka <mpatocka@...hat.com>
Cc: David Miller <davem@...emloft.net>
Cc: Chris Metcalf <cmetcalf@...era.com>
Cc: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: Vineet Gupta <vgupta@...opsys.com>
Cc: Jason Low <jason.low2@...com>
Cc: Waiman Long <waiman.long@...com>
Cc: "James E.J. Bottomley" <jejb@...isc-linux.org>
Cc: Paul McKenney <paulmck@...ux.vnet.ibm.com>
Cc: John David Anglin <dave.anglin@...l.net>
Cc: James Hogan <james.hogan@...tec.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Davidlohr Bueso <davidlohr@...com>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Russell King <linux@....linux.org.uk>
Cc: Will Deacon <will.deacon@....com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org
Cc: linuxppc-dev@...ts.ozlabs.org
Cc: sparclinux@...r.kernel.org
Link: http://lkml.kernel.org/r/20140606175316.GV13930@laptop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
[bwh: Backported to 3.2:
 - Adjust context
 - Drop arm64 change]
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1,6 +1,7 @@
 config ARM
 	bool
 	default y
+	select ARCH_SUPPORTS_ATOMIC_RMW
 	select HAVE_DMA_API_DEBUG
 	select HAVE_IDE if PCI || ISA || PCMCIA
 	select HAVE_MEMBLOCK
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -137,6 +137,7 @@ config PPC
 	select HAVE_BPF_JIT if (PPC64 && NET)
 	select HAVE_ARCH_JUMP_LABEL
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
+	select ARCH_SUPPORTS_ATOMIC_RMW
 
 config EARLY_PRINTK
 	bool
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -57,6 +57,7 @@ config SPARC64
 	select IRQ_PREFLOW_FASTEOI
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
 	select HAVE_C_RECORDMCOUNT
+	select ARCH_SUPPORTS_ATOMIC_RMW
 
 config ARCH_DEFCONFIG
 	string
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -75,6 +75,7 @@ config X86
 	select HAVE_BPF_JIT if (X86_64 && NET)
 	select CLKEVT_I8253
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
+	select ARCH_SUPPORTS_ATOMIC_RMW
 
 config INSTRUCTION_DECODER
 	def_bool (KPROBES || PERF_EVENTS)
--- a/kernel/Kconfig.locks
+++ b/kernel/Kconfig.locks
@@ -198,5 +198,9 @@ config INLINE_WRITE_UNLOCK_IRQ
 config INLINE_WRITE_UNLOCK_IRQRESTORE
 	def_bool !DEBUG_SPINLOCK && ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
 
+config ARCH_SUPPORTS_ATOMIC_RMW
+	bool
+
 config MUTEX_SPIN_ON_OWNER
-	def_bool SMP && !DEBUG_MUTEXES
+	def_bool y
+	depends on SMP && !DEBUG_MUTEXES && ARCH_SUPPORTS_ATOMIC_RMW

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