Skip to content

Commit 92d3306

Browse files
Sebastian Andrzej SiewiorKAGA-KOKO
authored andcommitted
x86/vdso: Provide getcpu for x86-32.
Wire up __vdso_getcpu() for x86-32. The 64bit version is reused with trivial modifications. Contrary to vclock_gettime.c there is no requirement to fake any defines in the case of 32bit VDSO on a 64bit kernel because the GDT entry from which the CPU and node information is read is always the native one. Adopt vdso_getcpu.c by: - removing the unneeded time* header files which lead to compile errors for 32bit. - adding segment.h which provides vdso_read_cpunode() and the defines required by it. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 717cce3 commit 92d3306

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

arch/x86/entry/vdso/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ VDSO32-$(CONFIG_IA32_EMULATION) := y
2929
# files to link into the vdso
3030
vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
3131
vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
32-
vobjs32-y += vdso32/vclock_gettime.o
32+
vobjs32-y += vdso32/vclock_gettime.o vdso32/vgetcpu.o
3333
vobjs-$(CONFIG_X86_SGX) += vsgx.o
3434

3535
# files to link into kernel
@@ -104,6 +104,7 @@ $(vobjs): KBUILD_AFLAGS += -DBUILD_VDSO
104104
CFLAGS_REMOVE_vclock_gettime.o = -pg
105105
CFLAGS_REMOVE_vdso32/vclock_gettime.o = -pg
106106
CFLAGS_REMOVE_vgetcpu.o = -pg
107+
CFLAGS_REMOVE_vdso32/vgetcpu.o = -pg
107108
CFLAGS_REMOVE_vsgx.o = -pg
108109

109110
#

arch/x86/entry/vdso/vdso32/vdso32.lds.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ VERSION
2828
__vdso_time;
2929
__vdso_clock_getres;
3030
__vdso_clock_gettime64;
31+
__vdso_getcpu;
3132
};
3233

3334
LINUX_2.5 {

arch/x86/entry/vdso/vdso32/vgetcpu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include "../vgetcpu.c"

arch/x86/entry/vdso/vgetcpu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
#include <linux/kernel.h>
99
#include <linux/getcpu.h>
10-
#include <linux/time.h>
11-
#include <asm/vgtod.h>
10+
#include <asm/segment.h>
1211

1312
notrace long
1413
__vdso_getcpu(unsigned *cpu, unsigned *node, struct getcpu_cache *unused)

0 commit comments

Comments
 (0)