Skip to content

Commit 7821571

Browse files
t-8chKAGA-KOKO
authored andcommitted
x86/vdso: Access rng data from kernel without vvar
Remove the usage of the vvar _vdso_rng_data from the kernel-space code, as the x86 vvar machinery is about to be removed. The definition of the structure is unnecessary, as the data lives in a page pre-allocated by the linker anyways. The vdso user-space access to the rng data will be switched soon. DEFINE_VVAR_SINGLE() is now unused. It will be removed later togehter with the rest of vvar.h. 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 9f8514c commit 7821571

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

arch/x86/entry/vdso/vma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
3939
#undef EMIT_VVAR
4040

4141
DEFINE_VVAR(struct vdso_data, _vdso_data);
42-
DEFINE_VVAR_SINGLE(struct vdso_rng_data, _vdso_rng_data);
4342

4443
unsigned int vclocks_used __read_mostly;
4544

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct vdso_data *__x86_get_k_vdso_data(void)
2121
static __always_inline
2222
struct vdso_rng_data *__x86_get_k_vdso_rng_data(void)
2323
{
24-
return &_vdso_rng_data;
24+
return (void *)&__vvar_page + __VDSO_RND_DATA_OFFSET;
2525
}
2626
#define __arch_get_k_vdso_rng_data __x86_get_k_vdso_rng_data
2727

arch/x86/include/asm/vvar.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#ifndef _ASM_X86_VVAR_H
2020
#define _ASM_X86_VVAR_H
2121

22+
#define __VDSO_RND_DATA_OFFSET 640
23+
2224
#ifdef EMIT_VVAR
2325
/*
2426
* EMIT_VVAR() is used by the kernel linker script to put vvars in the
@@ -62,7 +64,7 @@ DECLARE_VVAR(0, struct vdso_data, _vdso_data)
6264

6365
#if !defined(_SINGLE_DATA)
6466
#define _SINGLE_DATA
65-
DECLARE_VVAR_SINGLE(640, struct vdso_rng_data, _vdso_rng_data)
67+
DECLARE_VVAR_SINGLE(__VDSO_RND_DATA_OFFSET, struct vdso_rng_data, _vdso_rng_data)
6668
#endif
6769

6870
#undef DECLARE_VVAR

0 commit comments

Comments
 (0)