Skip to content

Commit 7d4acba

Browse files
t-8chKAGA-KOKO
authored andcommitted
x86/vdso: Access vdso data without vvar.h
The vdso_data is at the start of the vvar page. Make use of this invariant to remove the usage of vvar.h. This also matches the logic for the timens data. Signed-off-by: Thomas Weißschuh <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 75ceb49 commit 7d4acba

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

arch/x86/entry/vdso/vdso-layout.lds.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ SECTIONS
2020
vvar_start = . - 4 * PAGE_SIZE;
2121
vvar_page = vvar_start;
2222

23-
/* Place all vvars at the offsets in asm/vvar.h. */
24-
#define EMIT_VVAR(name, offset) vvar_ ## name = vvar_page + offset;
25-
#include <asm/vvar.h>
26-
#undef EMIT_VVAR
27-
2823
vdso_rng_data = vvar_page + __VDSO_RND_DATA_OFFSET;
2924

3025
pvclock_page = vvar_start + PAGE_SIZE;

arch/x86/include/asm/vdso/gettimeofday.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
#include <uapi/linux/time.h>
1616
#include <asm/vgtod.h>
17-
#include <asm/vvar.h>
1817
#include <asm/unistd.h>
1918
#include <asm/msr.h>
2019
#include <asm/pvclock.h>
2120
#include <clocksource/hyperv_timer.h>
2221

23-
#define __vdso_data (VVAR(_vdso_data))
22+
extern struct vdso_data vvar_page
23+
__attribute__((visibility("hidden")));
2424

2525
extern struct vdso_data timens_page
2626
__attribute__((visibility("hidden")));
@@ -277,7 +277,7 @@ static inline u64 __arch_get_hw_counter(s32 clock_mode,
277277

278278
static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
279279
{
280-
return __vdso_data;
280+
return &vvar_page;
281281
}
282282

283283
static inline bool arch_vdso_clocksource_ok(const struct vdso_data *vd)

0 commit comments

Comments
 (0)