diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2019-11-18 09:38:37 +0100 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2019-11-30 10:52:44 +0100 |
commit | 5a5525b0488ce31e19065f8527dbf50266b5b712 (patch) | |
tree | 962f0b570a299c36ea29f9dd2cb14943b488ca68 /arch/s390/kernel/vdso32 | |
parent | s390/smp,vdso: fix ASCE handling (diff) | |
download | linux-5a5525b0488ce31e19065f8527dbf50266b5b712.tar.xz linux-5a5525b0488ce31e19065f8527dbf50266b5b712.zip |
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>
Diffstat (limited to 'arch/s390/kernel/vdso32')
-rw-r--r-- | arch/s390/kernel/vdso32/getcpu.S | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/s390/kernel/vdso32/getcpu.S b/arch/s390/kernel/vdso32/getcpu.S index 25515f3fbcea..dc79e169f0ad 100644 --- a/arch/s390/kernel/vdso32/getcpu.S +++ b/arch/s390/kernel/vdso32/getcpu.S @@ -16,10 +16,8 @@ .type __kernel_getcpu,@function __kernel_getcpu: CFI_STARTPROC - la %r4,0 sacf 256 - l %r5,__VDSO_CPU_NR(%r4) - l %r4,__VDSO_NODE_ID(%r4) + lm %r4,%r5,__VDSO_GETCPU_VAL(%r0) sacf 0 ltr %r2,%r2 jz 2f |