Skip to content

Commit 070f5c1

Browse files
author
Fox Snowpatch
committed
1 parent f85c105 commit 070f5c1

Some content is hidden

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

57 files changed

+296
-563
lines changed

arch/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ config HAVE_SPARSE_SYSCALL_NR
15301530
entries at 4000, 5000 and 6000 locations. This option turns on syscall
15311531
related optimizations for a given architecture.
15321532

1533-
config ARCH_HAS_VDSO_DATA
1533+
config ARCH_HAS_VDSO_TIME_DATA
15341534
bool
15351535

15361536
config HAVE_STATIC_CALL

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

+1-3
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/vdso/Makefile

+1-1
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

-16
This file was deleted.

arch/arm/vdso/vdso.lds.S

+2-1
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

arch/arm64/include/asm/vdso.h

+1-8
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
#ifndef __ASM_VDSO_H
66
#define __ASM_VDSO_H
77

8-
/*
9-
* Default link address for the vDSO.
10-
* Since we randomise the VDSO mapping, there's little point in trying
11-
* to prelink this.
12-
*/
13-
#define VDSO_LBASE 0x0
14-
158
#define __VVAR_PAGES 2
169

1710
#ifndef __ASSEMBLY__
@@ -20,7 +13,7 @@
2013

2114
#define VDSO_SYMBOL(base, name) \
2215
({ \
23-
(void *)(vdso_offset_##name - VDSO_LBASE + (unsigned long)(base)); \
16+
(void *)(vdso_offset_##name + (unsigned long)(base)); \
2417
})
2518

2619
extern char vdso_start[], vdso_end[];

arch/arm64/kernel/vdso.c

+13-30
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ struct vdso_abi_info {
3939
const char *vdso_code_start;
4040
const char *vdso_code_end;
4141
unsigned long vdso_pages;
42-
/* Data Mapping */
43-
struct vm_special_mapping *dm;
4442
/* Code Mapping */
4543
struct vm_special_mapping *cm;
4644
};
@@ -113,6 +111,8 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
113111
return (struct vdso_data *)(vvar_page);
114112
}
115113

114+
static const struct vm_special_mapping vvar_map;
115+
116116
/*
117117
* The vvar mapping contains data for a specific time namespace, so when a task
118118
* changes namespace we must unmap its vvar data for the old namespace.
@@ -129,12 +129,8 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns)
129129
mmap_read_lock(mm);
130130

131131
for_each_vma(vmi, vma) {
132-
if (vma_is_special_mapping(vma, vdso_info[VDSO_ABI_AA64].dm))
133-
zap_vma_pages(vma);
134-
#ifdef CONFIG_COMPAT_VDSO
135-
if (vma_is_special_mapping(vma, vdso_info[VDSO_ABI_AA32].dm))
132+
if (vma_is_special_mapping(vma, &vvar_map))
136133
zap_vma_pages(vma);
137-
#endif
138134
}
139135

140136
mmap_read_unlock(mm);
@@ -176,6 +172,11 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
176172
return vmf_insert_pfn(vma, vmf->address, pfn);
177173
}
178174

175+
static const struct vm_special_mapping vvar_map = {
176+
.name = "[vvar]",
177+
.fault = vvar_fault,
178+
};
179+
179180
static int __setup_additional_pages(enum vdso_abi abi,
180181
struct mm_struct *mm,
181182
struct linux_binprm *bprm,
@@ -199,7 +200,7 @@ static int __setup_additional_pages(enum vdso_abi abi,
199200

200201
ret = _install_special_mapping(mm, vdso_base, VVAR_NR_PAGES * PAGE_SIZE,
201202
VM_READ|VM_MAYREAD|VM_PFNMAP,
202-
vdso_info[abi].dm);
203+
&vvar_map);
203204
if (IS_ERR(ret))
204205
goto up_fail;
205206

@@ -229,7 +230,6 @@ static int __setup_additional_pages(enum vdso_abi abi,
229230
enum aarch32_map {
230231
AA32_MAP_VECTORS, /* kuser helpers */
231232
AA32_MAP_SIGPAGE,
232-
AA32_MAP_VVAR,
233233
AA32_MAP_VDSO,
234234
};
235235

@@ -254,10 +254,6 @@ static struct vm_special_mapping aarch32_vdso_maps[] = {
254254
.pages = &aarch32_sig_page,
255255
.mremap = aarch32_sigpage_mremap,
256256
},
257-
[AA32_MAP_VVAR] = {
258-
.name = "[vvar]",
259-
.fault = vvar_fault,
260-
},
261257
[AA32_MAP_VDSO] = {
262258
.name = "[vdso]",
263259
.mremap = vdso_mremap,
@@ -307,7 +303,6 @@ static int __init __aarch32_alloc_vdso_pages(void)
307303
if (!IS_ENABLED(CONFIG_COMPAT_VDSO))
308304
return 0;
309305

310-
vdso_info[VDSO_ABI_AA32].dm = &aarch32_vdso_maps[AA32_MAP_VVAR];
311306
vdso_info[VDSO_ABI_AA32].cm = &aarch32_vdso_maps[AA32_MAP_VDSO];
312307

313308
return __vdso_init(VDSO_ABI_AA32);
@@ -402,26 +397,14 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
402397
}
403398
#endif /* CONFIG_COMPAT */
404399

405-
enum aarch64_map {
406-
AA64_MAP_VVAR,
407-
AA64_MAP_VDSO,
408-
};
409-
410-
static struct vm_special_mapping aarch64_vdso_maps[] __ro_after_init = {
411-
[AA64_MAP_VVAR] = {
412-
.name = "[vvar]",
413-
.fault = vvar_fault,
414-
},
415-
[AA64_MAP_VDSO] = {
416-
.name = "[vdso]",
417-
.mremap = vdso_mremap,
418-
},
400+
static struct vm_special_mapping aarch64_vdso_map __ro_after_init = {
401+
.name = "[vdso]",
402+
.mremap = vdso_mremap,
419403
};
420404

421405
static int __init vdso_init(void)
422406
{
423-
vdso_info[VDSO_ABI_AA64].dm = &aarch64_vdso_maps[AA64_MAP_VVAR];
424-
vdso_info[VDSO_ABI_AA64].cm = &aarch64_vdso_maps[AA64_MAP_VDSO];
407+
vdso_info[VDSO_ABI_AA64].cm = &aarch64_vdso_map;
425408

426409
return __vdso_init(VDSO_ABI_AA64);
427410
}

arch/arm64/kernel/vdso/vdso.lds.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ SECTIONS
2525
#ifdef CONFIG_TIME_NS
2626
PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
2727
#endif
28-
. = VDSO_LBASE + SIZEOF_HEADERS;
28+
. = SIZEOF_HEADERS;
2929

3030
.hash : { *(.hash) } :text
3131
.gnu.hash : { *(.gnu.hash) }

arch/arm64/kernel/vdso32/vdso.lds.S

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SECTIONS
2222
#ifdef CONFIG_TIME_NS
2323
PROVIDE_HIDDEN(_timens_data = _vdso_data + PAGE_SIZE);
2424
#endif
25-
. = VDSO_LBASE + SIZEOF_HEADERS;
25+
. = SIZEOF_HEADERS;
2626

2727
.hash : { *(.hash) } :text
2828
.gnu.hash : { *(.gnu.hash) }

arch/csky/Kconfig

-4
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ config CSKY
6464
select GENERIC_IRQ_MULTI_HANDLER
6565
select GENERIC_SCHED_CLOCK
6666
select GENERIC_SMP_IDLE_THREAD
67-
select GENERIC_TIME_VSYSCALL
68-
select GENERIC_VDSO_32
69-
select GENERIC_GETTIMEOFDAY
7067
select GX6605S_TIMER if CPU_CK610
7168
select HAVE_ARCH_TRACEHOOK
7269
select HAVE_ARCH_AUDITSYSCALL
@@ -80,7 +77,6 @@ config CSKY
8077
select HAVE_DEBUG_KMEMLEAK
8178
select HAVE_DYNAMIC_FTRACE
8279
select HAVE_DYNAMIC_FTRACE_WITH_REGS
83-
select HAVE_GENERIC_VDSO
8480
select HAVE_FUNCTION_TRACER
8581
select HAVE_FUNCTION_GRAPH_TRACER
8682
select HAVE_FUNCTION_ERROR_INJECTION

arch/csky/include/asm/vdso/clocksource.h

-9
This file was deleted.

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

-114
This file was deleted.

arch/csky/include/asm/vdso/processor.h

-12
This file was deleted.

0 commit comments

Comments
 (0)