Skip to content

Commit 38ea1f3

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390/32bit: fix cmpxchg64
Fix broken inline assembly contraints for cmpxchg64 on 32bit. Fixes this crash: specification exception: 0006 [#1] SMP CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.13.0 #4 task: 005a16c8 ti: 00592000 task.ti: 00592000 Krnl PSW : 070ce000 8029abd6 (lockref_get+0x3e/0x9c) ... Krnl Code: 8029abcc: a71a0001 ahi %r1,1 8029abd0: 1852 lr %r5,%r2 #8029abd2: bb40f064 cds %r4,%r0,100(%r15) >8029abd6: 1943 cr %r4,%r3 8029abd8: 1815 lr %r1,%r5 Call Trace: ([<0000000078e01870>] 0x78e01870) [<000000000021105a>] sysfs_mount+0xd2/0x1c8 [<00000000001b551e>] mount_fs+0x3a/0x134 [<00000000001ce768>] vfs_kern_mount+0x44/0x11c [<00000000001ce864>] kern_mount_data+0x24/0x3c [<00000000005cc4b8>] sysfs_init+0x74/0xd4 [<00000000005cb5b4>] mnt_init+0xe0/0x1fc [<00000000005cb16a>] vfs_caches_init+0xb6/0x14c [<00000000005be794>] start_kernel+0x318/0x33c [<000000000010001c>] _stext+0x1c/0x80 Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 7e2e2b9 commit 38ea1f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/s390/include/asm/cmpxchg.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ static inline unsigned long long __cmpxchg64(void *ptr,
185185
{
186186
register_pair rp_old = {.pair = old};
187187
register_pair rp_new = {.pair = new};
188+
unsigned long long *ullptr = ptr;
188189

189190
asm volatile(
190191
" cds %0,%2,%1"
191-
: "+&d" (rp_old), "=Q" (ptr)
192-
: "d" (rp_new), "Q" (ptr)
192+
: "+d" (rp_old), "+Q" (*ullptr)
193+
: "d" (rp_new)
193194
: "memory", "cc");
194195
return rp_old.pair;
195196
}

0 commit comments

Comments
 (0)