Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98d0ac38 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by H. Peter Anvin
Browse files

x86-64: Move vread_tsc and vread_hpet into the vDSO



The vsyscall page now consists entirely of trap instructions.

Cc: John Stultz <johnstul@us.ibm.com>
Signed-off-by: default avatarAndy Lutomirski <luto@mit.edu>
Link: http://lkml.kernel.org/r/637648f303f2ef93af93bae25186e9a1bea093f5.1310639973.git.luto@mit.edu


Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 433bd805
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -7,8 +7,12 @@

#define __ARCH_HAS_CLOCKSOURCE_DATA

#define VCLOCK_NONE 0  /* No vDSO clock available.	*/
#define VCLOCK_TSC  1  /* vDSO should use vread_tsc.	*/
#define VCLOCK_HPET 2  /* vDSO should use vread_hpet.	*/

struct arch_clocksource_data {
	cycle_t (*vread)(void);
	int vclock_mode;
};

#endif /* CONFIG_X86_64 */
+0 −4
Original line number Diff line number Diff line
@@ -51,10 +51,6 @@ extern int unsynchronized_tsc(void);
extern int check_tsc_unstable(void);
extern unsigned long native_calibrate_tsc(void);

#ifdef CONFIG_X86_64
extern cycles_t vread_tsc(void);
#endif

/*
 * Boot-time check whether the TSCs are synchronized across
 * all CPUs/cores:
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ struct vsyscall_gtod_data {

	struct timezone sys_tz;
	struct { /* extract of a clocksource struct */
		cycle_t (*vread)(void);
		int vclock_mode;
		cycle_t	cycle_last;
		cycle_t	mask;
		u32	mult;
+0 −4
Original line number Diff line number Diff line
@@ -16,10 +16,6 @@ enum vsyscall_num {
#ifdef __KERNEL__
#include <linux/seqlock.h>

/* Definitions for CONFIG_GENERIC_TIME definitions */
#define __vsyscall_fn \
	__attribute__ ((unused, __section__(".vsyscall_fn"))) notrace

#define VGETCPU_RDTSCP	1
#define VGETCPU_LSL	2

+1 −6
Original line number Diff line number Diff line
@@ -24,17 +24,12 @@ endif
nostackp := $(call cc-option, -fno-stack-protector)
CFLAGS_vsyscall_64.o	:= $(PROFILING) -g0 $(nostackp)
CFLAGS_hpet.o		:= $(nostackp)
CFLAGS_vread_tsc_64.o	:= $(nostackp)
CFLAGS_paravirt.o	:= $(nostackp)
GCOV_PROFILE_vsyscall_64.o	:= n
GCOV_PROFILE_hpet.o		:= n
GCOV_PROFILE_tsc.o		:= n
GCOV_PROFILE_vread_tsc_64.o	:= n
GCOV_PROFILE_paravirt.o		:= n

# vread_tsc_64 is hot and should be fully optimized:
CFLAGS_REMOVE_vread_tsc_64.o = -pg -fno-optimize-sibling-calls

obj-y			:= process_$(BITS).o signal.o entry_$(BITS).o
obj-y			+= traps.o irq.o irq_$(BITS).o dumpstack_$(BITS).o
obj-y			+= time.o ioport.o ldt.o dumpstack.o
@@ -43,7 +38,7 @@ obj-$(CONFIG_IRQ_WORK) += irq_work.o
obj-y			+= probe_roms.o
obj-$(CONFIG_X86_32)	+= sys_i386_32.o i386_ksyms_32.o
obj-$(CONFIG_X86_64)	+= sys_x86_64.o x8664_ksyms_64.o
obj-$(CONFIG_X86_64)	+= syscall_64.o vsyscall_64.o vread_tsc_64.o
obj-$(CONFIG_X86_64)	+= syscall_64.o vsyscall_64.o
obj-$(CONFIG_X86_64)	+= vsyscall_emu_64.o
obj-y			+= bootflag.o e820.o
obj-y			+= pci-dma.o quirks.o topology.o kdebugfs.o
Loading