summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-11-26 14:28:25 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-11-28 14:12:04 +0100
commit1200f216a3043ad78e89ce1f573fe6d62ed5e5d0 (patch)
tree125fec8ae83b8d40611300ccc758f9b36a4f68ea /arch/s390
parent2c3bc137f1e339c4fa9485ec4028433b8cb7374b (diff)
downloadlinux-stable-1200f216a3043ad78e89ce1f573fe6d62ed5e5d0.tar.gz
linux-stable-1200f216a3043ad78e89ce1f573fe6d62ed5e5d0.tar.bz2
linux-stable-1200f216a3043ad78e89ce1f573fe6d62ed5e5d0.zip
s390/spinlock: Generate shorter code for arch_spin_unlock()
Use mvhhi instead of sth to write a zero to spinlocks. Compared to the sth variant this avoids the load of zero to a register, and reduces register pressure. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/include/asm/spinlock.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 9601e27d3291..f87dd0a84855 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -82,9 +82,9 @@ static inline void arch_spin_unlock(arch_spinlock_t *lp)
kcsan_release();
asm_inline volatile(
ALTERNATIVE("nop", ".insn rre,0xb2fa0000,7,0", ALT_FACILITY(49)) /* NIAI 7 */
- " sth %[zero],%[lock]\n"
- : [lock] "=R" (((unsigned short *)&lp->lock)[1])
- : [zero] "d" (0)
+ " mvhhi %[lock],0\n"
+ : [lock] "=Q" (((unsigned short *)&lp->lock)[1])
+ :
: "memory");
}