4bff8cb545
Convert s390 to generic vDSO. There are a few special things on s390: - vDSO can be called without a stack frame - glibc did this in the past. So we need to allocate a stackframe on our own. - The former assembly code used stcke to get the TOD clock and applied time steering to it. We need to do the same in the new code. This is done in the architecture specific __arch_get_hw_counter function. The steering information is stored in an architecure specific area in the vDSO data. - CPUCLOCK_VIRT is now handled with a syscall fallback, which might be slower/less accurate than the old implementation. The getcpu() function stays as an assembly function because there is no generic implementation and the code is just a few lines. Performance number from my system do 100 mio gettimeofday() calls: Plain syscall: 8.6s Generic VDSO: 1.3s old ASM VDSO: 1s So it's a bit slower but still much faster than syscalls. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
27 lines
644 B
C
27 lines
644 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_VDSO_VSYSCALL_H
|
|
#define __ASM_VDSO_VSYSCALL_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <linux/hrtimer.h>
|
|
#include <linux/timekeeper_internal.h>
|
|
#include <vdso/datapage.h>
|
|
#include <asm/vdso.h>
|
|
/*
|
|
* Update the vDSO data page to keep in sync with kernel timekeeping.
|
|
*/
|
|
|
|
static __always_inline struct vdso_data *__s390_get_k_vdso_data(void)
|
|
{
|
|
return vdso_data;
|
|
}
|
|
#define __arch_get_k_vdso_data __s390_get_k_vdso_data
|
|
|
|
/* The asm-generic header needs to be included after the definitions above */
|
|
#include <asm-generic/vdso/vsyscall.h>
|
|
|
|
#endif /* !__ASSEMBLY__ */
|
|
|
|
#endif /* __ASM_VDSO_VSYSCALL_H */
|