diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 20:28:57 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-11-27 20:29:11 -0500 |
commit | 51c19b4f5927f5a646e93d69f73c7e89ea14e737 (patch) | |
tree | a48486f72dc433fd516684d4441022650429d333 /arch/x86/include/asm/vsyscall.h | |
parent | 3dc4f7cfb7441e5e0fed3a02fc81cdaabd28300a (diff) |
x86: vdso: pvclock gettime support
Improve performance of time system calls when using Linux pvclock,
by reading time info from fixmap visible copy of pvclock data.
Originally from Jeremy Fitzhardinge.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/vsyscall.h')
-rw-r--r-- | arch/x86/include/asm/vsyscall.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/include/asm/vsyscall.h b/arch/x86/include/asm/vsyscall.h index eaea1d31f753..80f80955cfd8 100644 --- a/arch/x86/include/asm/vsyscall.h +++ b/arch/x86/include/asm/vsyscall.h | |||
@@ -33,6 +33,26 @@ extern void map_vsyscall(void); | |||
33 | */ | 33 | */ |
34 | extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address); | 34 | extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address); |
35 | 35 | ||
36 | #ifdef CONFIG_X86_64 | ||
37 | |||
38 | #define VGETCPU_CPU_MASK 0xfff | ||
39 | |||
40 | static inline unsigned int __getcpu(void) | ||
41 | { | ||
42 | unsigned int p; | ||
43 | |||
44 | if (VVAR(vgetcpu_mode) == VGETCPU_RDTSCP) { | ||
45 | /* Load per CPU data from RDTSCP */ | ||
46 | native_read_tscp(&p); | ||
47 | } else { | ||
48 | /* Load per CPU data from GDT */ | ||
49 | asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG)); | ||
50 | } | ||
51 | |||
52 | return p; | ||
53 | } | ||
54 | #endif /* CONFIG_X86_64 */ | ||
55 | |||
36 | #endif /* __KERNEL__ */ | 56 | #endif /* __KERNEL__ */ |
37 | 57 | ||
38 | #endif /* _ASM_X86_VSYSCALL_H */ | 58 | #endif /* _ASM_X86_VSYSCALL_H */ |