diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2020-11-16 08:06:41 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2020-11-23 12:01:13 +0100 |
commit | 80f06306240e0ad1c75116111be11950474dfda7 (patch) | |
tree | 99ed304a1c6d26ad408145ba98b83d9fbf807b7f /arch/s390/kernel/vdso.c | |
parent | s390/mm: add debug user asce support (diff) | |
download | linux-80f06306240e0ad1c75116111be11950474dfda7.tar.xz linux-80f06306240e0ad1c75116111be11950474dfda7.zip |
s390/vdso: reimplement getcpu vdso syscall
Implement the previously removed getcpu vdso syscall by using the
TOD programmable field to pass the cpu number to user space.
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/vdso.c')
-rw-r--r-- | arch/s390/kernel/vdso.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c index 53c983f1ea51..aef2edff9959 100644 --- a/arch/s390/kernel/vdso.c +++ b/arch/s390/kernel/vdso.c @@ -29,6 +29,7 @@ #include <asm/sections.h> #include <asm/vdso.h> #include <asm/facility.h> +#include <asm/timex.h> extern char vdso64_start, vdso64_end; static void *vdso64_kbase = &vdso64_start; @@ -100,6 +101,11 @@ static union { } vdso_data_store __page_aligned_data; struct vdso_data *vdso_data = (struct vdso_data *)&vdso_data_store.data; +void vdso_getcpu_init(void) +{ + set_tod_programmable_field(smp_processor_id()); +} + /* * This is called from binfmt_elf, we create the special vma for the * vDSO and insert it into the mm struct tree @@ -170,6 +176,7 @@ static int __init vdso_init(void) { int i; + vdso_getcpu_init(); /* Calculate the size of the 64 bit vDSO */ vdso64_pages = ((&vdso64_end - &vdso64_start + PAGE_SIZE - 1) >> PAGE_SHIFT) + 1; |