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>
This commit is contained in:
@@ -33,6 +33,26 @@ extern void map_vsyscall(void);
|
||||
*/
|
||||
extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
|
||||
#define VGETCPU_CPU_MASK 0xfff
|
||||
|
||||
static inline unsigned int __getcpu(void)
|
||||
{
|
||||
unsigned int p;
|
||||
|
||||
if (VVAR(vgetcpu_mode) == VGETCPU_RDTSCP) {
|
||||
/* Load per CPU data from RDTSCP */
|
||||
native_read_tscp(&p);
|
||||
} else {
|
||||
/* Load per CPU data from GDT */
|
||||
asm("lsl %1,%0" : "=r" (p) : "r" (__PER_CPU_SEG));
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
#endif /* CONFIG_X86_64 */
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#endif /* _ASM_X86_VSYSCALL_H */
|
||||
|
Reference in New Issue
Block a user