mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00

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>
45 lines
1 KiB
C
45 lines
1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __S390_VDSO_H__
|
|
#define __S390_VDSO_H__
|
|
|
|
#include <vdso/datapage.h>
|
|
|
|
/* Default link addresses for the vDSOs */
|
|
#define VDSO32_LBASE 0
|
|
#define VDSO64_LBASE 0
|
|
|
|
#define VDSO_VERSION_STRING LINUX_2.6.29
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
/*
|
|
* Note about the vdso_data and vdso_per_cpu_data structures:
|
|
*
|
|
* NEVER USE THEM IN USERSPACE CODE DIRECTLY. The layout of the
|
|
* structure is supposed to be known only to the function in the vdso
|
|
* itself and may change without notice.
|
|
*/
|
|
|
|
struct vdso_per_cpu_data {
|
|
/*
|
|
* Note: node_id and cpu_nr must be at adjacent memory locations.
|
|
* VDSO userspace must read both values with a single instruction.
|
|
*/
|
|
union {
|
|
__u64 getcpu_val;
|
|
struct {
|
|
__u32 node_id;
|
|
__u32 cpu_nr;
|
|
};
|
|
};
|
|
};
|
|
|
|
extern struct vdso_data *vdso_data;
|
|
extern struct vdso_data boot_vdso_data;
|
|
|
|
void vdso_alloc_boot_cpu(struct lowcore *lowcore);
|
|
int vdso_alloc_per_cpu(struct lowcore *lowcore);
|
|
void vdso_free_per_cpu(struct lowcore *lowcore);
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
#endif /* __S390_VDSO_H__ */
|