Skip to content

Commit d60d7de

Browse files
svens-s390KAGA-KOKO
authored andcommitted
lib/vdso: Allow to add architecture-specific vdso data
The initial assumption that all VDSO related data can be completely generic does not hold. S390 needs architecture specific storage to access the clock steering information. Add struct arch_vdso_data to the vdso data struct. For architectures which do not need extra data this defaults to an empty struct. Architectures which require it, enable CONFIG_ARCH_HAS_VDSO_DATA and provide their specific struct in asm/vdso/data.h. Signed-off-by: Sven Schnelle <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 19d0070 commit d60d7de

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

arch/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,9 @@ config HAVE_SPARSE_SYSCALL_NR
975975
entries at 4000, 5000 and 6000 locations. This option turns on syscall
976976
related optimizations for a given architecture.
977977

978+
config ARCH_HAS_VDSO_DATA
979+
bool
980+
978981
source "kernel/gcov/Kconfig"
979982

980983
source "scripts/gcc-plugins/Kconfig"

include/vdso/datapage.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
#include <vdso/time32.h>
2020
#include <vdso/time64.h>
2121

22+
#ifdef CONFIG_ARCH_HAS_VDSO_DATA
23+
#include <asm/vdso/data.h>
24+
#else
25+
struct arch_vdso_data {};
26+
#endif
27+
2228
#define VDSO_BASES (CLOCK_TAI + 1)
2329
#define VDSO_HRES (BIT(CLOCK_REALTIME) | \
2430
BIT(CLOCK_MONOTONIC) | \
@@ -64,6 +70,8 @@ struct vdso_timestamp {
6470
* @tz_dsttime: type of DST correction
6571
* @hrtimer_res: hrtimer resolution
6672
* @__unused: unused
73+
* @arch_data: architecture specific data (optional, defaults
74+
* to an empty struct)
6775
*
6876
* vdso_data will be accessed by 64 bit and compat code at the same time
6977
* so we should be careful before modifying this structure.
@@ -97,6 +105,8 @@ struct vdso_data {
97105
s32 tz_dsttime;
98106
u32 hrtimer_res;
99107
u32 __unused;
108+
109+
struct arch_vdso_data arch_data;
100110
};
101111

102112
/*

0 commit comments

Comments
 (0)