aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.vnet.ibm.com>2017-10-12 13:01:47 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-10-18 14:11:33 +0200
commitf554be42fd0fd8dd14680c67f2db26b3e7de9670 (patch)
tree68d1e054f9a40bbe29d3d5b3c2ef79437d6e71ee /arch/s390/include
parents390: introduce CPU alternatives (diff)
downloadlinux-dev-f554be42fd0fd8dd14680c67f2db26b3e7de9670.tar.xz
linux-dev-f554be42fd0fd8dd14680c67f2db26b3e7de9670.zip
s390/spinlock: use cpu alternatives to enable niai instruction
Enable niai instruction in the spinlock code at run-time for machines on which facility 49 is available (zEC12 and newer). Signed-off-by: Vasily Gorbik <gor@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/spinlock.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 09e783d83d5d..709cb6c01db9 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -13,6 +13,7 @@
#include <asm/atomic_ops.h>
#include <asm/barrier.h>
#include <asm/processor.h>
+#include <asm/alternative.h>
#define SPINLOCK_LOCKVAL (S390_lowcore.spinlock_lockval)
@@ -86,9 +87,7 @@ static inline void arch_spin_unlock(arch_spinlock_t *lp)
{
typecheck(int, lp->lock);
asm volatile(
-#ifdef CONFIG_HAVE_MARCH_ZEC12_FEATURES
- " .long 0xb2fa0070\n" /* NIAI 7 */
-#endif
+ ALTERNATIVE("", ".long 0xb2fa0070", 49) /* NIAI 7 */
" sth %1,%0\n"
: "=Q" (((unsigned short *) &lp->lock)[1])
: "d" (0) : "cc", "memory");