From 80f06306240e0ad1c75116111be11950474dfda7 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 16 Nov 2020 08:06:41 +0100 Subject: 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 Signed-off-by: Heiko Carstens --- arch/s390/kernel/vdso.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'arch/s390/kernel/vdso.c') 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 #include #include +#include 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; -- cgit v1.2.3