s390/vdso: fix getcpu
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 18 Nov 2019 08:38:37 +0000 (09:38 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Sat, 30 Nov 2019 09:52:44 +0000 (10:52 +0100)
commit5a5525b0488ce31e19065f8527dbf50266b5b712
tree962f0b570a299c36ea29f9dd2cb14943b488ca68
parenta2308c11ecbc3471ebb7435ee8075815b1502ef0
s390/vdso: fix getcpu

getcpu reads the required values for cpu and node with two
instructions. This might lead to an inconsistent result if user space
gets preempted and migrated to a different CPU between the two
instructions.

Fix this by using just a single instruction to read both values at
once.

This is currently rather a theoretical bug, since there is no real
NUMA support available (except for NUMA emulation).

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/vdso.h
arch/s390/kernel/asm-offsets.c
arch/s390/kernel/vdso32/getcpu.S
arch/s390/kernel/vdso64/getcpu.S