Skip to content

Commit 0352387

Browse files
committed
Merge tag 'timers-vdso-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull vdso data page handling updates from Thomas Gleixner: "First steps of consolidating the VDSO data page handling. The VDSO data page handling is architecture specific for historical reasons, but there is no real technical reason to do so. Aside of that VDSO data has become a dump ground for various mechanisms and fail to provide a clear separation of the functionalities. Clean this up by: - consolidating the VDSO page data by getting rid of architecture specific warts especially in x86 and PowerPC. - removing the last includes of header files which are pulling in other headers outside of the VDSO namespace. - seperating timekeeping and other VDSO data accordingly. Further consolidation of the VDSO page handling is done in subsequent changes scheduled for the next merge window. This also lays the ground for expanding the VDSO time getters for independent PTP clocks in a generic way without making every architecture add support seperately" * tag 'timers-vdso-2024-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits) x86/vdso: Add missing brackets in switch case vdso: Rename struct arch_vdso_data to arch_vdso_time_data powerpc: Split systemcfg struct definitions out from vdso powerpc: Split systemcfg data out of vdso data page powerpc: Add kconfig option for the systemcfg page powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors powerpc/pseries/lparcfg: Fix printing of system_active_processors powerpc/procfs: Propagate error of remap_pfn_range() powerpc/vdso: Remove offset comment from 32bit vdso_arch_data x86/vdso: Split virtual clock pages into dedicated mapping x86/vdso: Delete vvar.h x86/vdso: Access vdso data without vvar.h x86/vdso: Move the rng offset to vsyscall.h x86/vdso: Access rng vdso data without vvar.h x86/vdso: Access timens vdso data without vvar.h x86/vdso: Allocate vvar page from C code x86/vdso: Access rng data from kernel without vvar x86/vdso: Place vdso_data at beginning of vvar page x86/vdso: Use __arch_get_vdso_data() to access vdso data x86/mm/mmap: Remove arch_vma_name() ...
2 parents 5c2b050 + 7fa3c36 commit 0352387

File tree

98 files changed

+372
-782
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+372
-782
lines changed

arch/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ config HAVE_SPARSE_SYSCALL_NR
15291529
entries at 4000, 5000 and 6000 locations. This option turns on syscall
15301530
related optimizations for a given architecture.
15311531

1532-
config ARCH_HAS_VDSO_DATA
1532+
config ARCH_HAS_VDSO_TIME_DATA
15331533
bool
15341534

15351535
config HAVE_STATIC_CALL

arch/alpha/include/asm/page.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
#include <linux/const.h>
66
#include <asm/pal.h>
7-
8-
/* PAGE_SHIFT determines the page size */
9-
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
10-
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
11-
#define PAGE_MASK (~(PAGE_SIZE-1))
7+
#include <vdso/page.h>
128

139
#ifndef __ASSEMBLY__
1410

arch/arc/include/uapi/asm/page.h

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

1515
/* PAGE_SHIFT determines the page size */
1616
#ifdef __KERNEL__
17-
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
17+
#include <vdso/page.h>
1818
#else
1919
/*
2020
* Default 8k
@@ -24,11 +24,10 @@
2424
* not available
2525
*/
2626
#define PAGE_SHIFT 13
27+
#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */
28+
#define PAGE_MASK (~(PAGE_SIZE-1))
2729
#endif
2830

29-
#define PAGE_SIZE _BITUL(PAGE_SHIFT) /* Default 8K */
3031
#define PAGE_OFFSET _AC(0x80000000, UL) /* Kernel starts at 2G onwrds */
3132

32-
#define PAGE_MASK (~(PAGE_SIZE-1))
33-
3433
#endif /* _UAPI__ASM_ARC_PAGE_H */

arch/arm/include/asm/page.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
#ifndef _ASMARM_PAGE_H
88
#define _ASMARM_PAGE_H
99

10-
/* PAGE_SHIFT determines the page size */
11-
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
12-
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
13-
#define PAGE_MASK (~((1 << PAGE_SHIFT) - 1))
10+
#include <vdso/page.h>
1411

1512
#ifndef __ASSEMBLY__
1613

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
#define VDSO_HAS_CLOCK_GETRES 1
1717

18-
extern struct vdso_data *__get_datapage(void);
19-
2018
static __always_inline int gettimeofday_fallback(
2119
struct __kernel_old_timeval *_tv,
2220
struct timezone *_tz)
@@ -139,7 +137,7 @@ static __always_inline u64 __arch_get_hw_counter(int clock_mode,
139137

140138
static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
141139
{
142-
return __get_datapage();
140+
return _vdso_data;
143141
}
144142

145143
#endif /* !__ASSEMBLY__ */

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44

55
#ifndef __ASSEMBLY__
66

7-
#include <linux/timekeeper_internal.h>
87
#include <vdso/datapage.h>
98
#include <asm/cacheflush.h>
109

1110
extern struct vdso_data *vdso_data;
1211
extern bool cntvct_ok;
1312

14-
/*
15-
* Update the vDSO data page to keep in sync with kernel timekeeping.
16-
*/
1713
static __always_inline
1814
struct vdso_data *__arm_get_k_vdso_data(void)
1915
{

arch/arm/kernel/vdso.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/of.h>
1515
#include <linux/printk.h>
1616
#include <linux/slab.h>
17-
#include <linux/timekeeper_internal.h>
1817
#include <linux/vmalloc.h>
1918
#include <asm/arch_timer.h>
2019
#include <asm/barrier.h>

arch/arm/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include $(srctree)/lib/vdso/Makefile
55

66
hostprogs := vdsomunge
77

8-
obj-vdso := vgettimeofday.o datapage.o note.o
8+
obj-vdso := vgettimeofday.o note.o
99

1010
# Build rules
1111
targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.so.raw vdso.lds

arch/arm/vdso/datapage.S

Lines changed: 0 additions & 16 deletions
This file was deleted.

arch/arm/vdso/vdso.lds.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include <linux/const.h>
14+
#include <asm/asm-offsets.h>
1415
#include <asm/page.h>
1516
#include <asm/vdso.h>
1617

@@ -19,7 +20,7 @@ OUTPUT_ARCH(arm)
1920

2021
SECTIONS
2122
{
22-
PROVIDE(_start = .);
23+
PROVIDE(_vdso_data = . - VDSO_DATA_SIZE);
2324

2425
. = SIZEOF_HEADERS;
2526

0 commit comments

Comments
 (0)