Skip to content

Commit

Permalink
x86/vdso: Access vdso data without vvar.h
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
t-8ch authored and KAGA-KOKO committed Nov 2, 2024
1 parent 75ceb49 commit 7d4acba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions arch/x86/entry/vdso/vdso-layout.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ SECTIONS
vvar_start = . - 4 * PAGE_SIZE;
vvar_page = vvar_start;

/* Place all vvars at the offsets in asm/vvar.h. */
#define EMIT_VVAR(name, offset) vvar_ ## name = vvar_page + offset;
#include <asm/vvar.h>
#undef EMIT_VVAR

vdso_rng_data = vvar_page + __VDSO_RND_DATA_OFFSET;

pvclock_page = vvar_start + PAGE_SIZE;
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/include/asm/vdso/gettimeofday.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

#include <uapi/linux/time.h>
#include <asm/vgtod.h>
#include <asm/vvar.h>
#include <asm/unistd.h>
#include <asm/msr.h>
#include <asm/pvclock.h>
#include <clocksource/hyperv_timer.h>

#define __vdso_data (VVAR(_vdso_data))
extern struct vdso_data vvar_page
__attribute__((visibility("hidden")));

extern struct vdso_data timens_page
__attribute__((visibility("hidden")));
Expand Down Expand Up @@ -277,7 +277,7 @@ static inline u64 __arch_get_hw_counter(s32 clock_mode,

static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
{
return __vdso_data;
return &vvar_page;
}

static inline bool arch_vdso_clocksource_ok(const struct vdso_data *vd)
Expand Down

0 comments on commit 7d4acba

Please sign in to comment.