Skip to content

Commit 7d298d2

Browse files
t-8chKAGA-KOKO
authored andcommitted
vdso: Move ENABLE_COMPAT_VDSO from core to arm64
The ENABLE_COMAPT_VDSO symbol is only used by arm64 and only for the time-related functionality. There should be no new users, so it doesn't need to be in the generic vDSO code. Move the logic into arm64 architecture-specific code and replace the explicit define by the standard '#ifdef __aarch64__'. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/all/20250826-vdso-cleanups-v1-3-d9b65750e49f@linutronix.de
1 parent 39f1ee1 commit 7d298d2

5 files changed

Lines changed: 14 additions & 12 deletions

File tree

arch/arm64/include/asm/vdso/compat_barrier.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@
77

88
#ifndef __ASSEMBLY__
99
/*
10-
* Warning: This code is meant to be used with
11-
* ENABLE_COMPAT_VDSO only.
10+
* Warning: This code is meant to be used from the compat vDSO only.
1211
*/
13-
#ifndef ENABLE_COMPAT_VDSO
14-
#error This header is meant to be used with ENABLE_COMPAT_VDSO only
12+
#ifdef __arch64__
13+
#error This header is meant to be used with from the compat vDSO only
1514
#endif
1615

1716
#ifdef dmb

arch/arm64/include/asm/vdso/compat_gettimeofday.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/*
33
* Copyright (C) 2018 ARM Limited
44
*/
5-
#ifndef __ASM_VDSO_GETTIMEOFDAY_H
6-
#define __ASM_VDSO_GETTIMEOFDAY_H
5+
#ifndef __ASM_VDSO_COMPAT_GETTIMEOFDAY_H
6+
#define __ASM_VDSO_COMPAT_GETTIMEOFDAY_H
77

88
#ifndef __ASSEMBLY__
99

@@ -163,4 +163,4 @@ static inline bool vdso_clocksource_ok(const struct vdso_clock *vc)
163163

164164
#endif /* !__ASSEMBLY__ */
165165

166-
#endif /* __ASM_VDSO_GETTIMEOFDAY_H */
166+
#endif /* __ASM_VDSO_COMPAT_GETTIMEOFDAY_H */

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef __ASM_VDSO_GETTIMEOFDAY_H
66
#define __ASM_VDSO_GETTIMEOFDAY_H
77

8+
#ifdef __aarch64__
9+
810
#ifndef __ASSEMBLY__
911

1012
#include <asm/alternative.h>
@@ -96,4 +98,10 @@ static __always_inline const struct vdso_time_data *__arch_get_vdso_u_time_data(
9698

9799
#endif /* !__ASSEMBLY__ */
98100

101+
#else /* !__aarch64__ */
102+
103+
#include "compat_gettimeofday.h"
104+
105+
#endif /* __aarch64__ */
106+
99107
#endif /* __ASM_VDSO_GETTIMEOFDAY_H */

arch/arm64/kernel/vdso32/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ VDSO_CAFLAGS += -DDISABLE_BRANCH_PROFILING
5959
VDSO_CAFLAGS += -march=armv8-a
6060

6161
VDSO_CFLAGS := $(VDSO_CAFLAGS)
62-
VDSO_CFLAGS += -DENABLE_COMPAT_VDSO=1
6362
# KBUILD_CFLAGS from top-level Makefile
6463
VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
6564
-fno-strict-aliasing -fno-common \

include/vdso/datapage.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,7 @@ enum vdso_pages {
196196
* - clock_gettime_fallback(): fallback for clock_gettime.
197197
* - clock_getres_fallback(): fallback for clock_getres.
198198
*/
199-
#ifdef ENABLE_COMPAT_VDSO
200-
#include <asm/vdso/compat_gettimeofday.h>
201-
#else
202199
#include <asm/vdso/gettimeofday.h>
203-
#endif /* ENABLE_COMPAT_VDSO */
204200

205201
#else /* !__ASSEMBLY__ */
206202

0 commit comments

Comments
 (0)