 +
 +notrace int __vdso_get_vcounter_latency(vcounter_t *vcounter, cycle_t *vcount_lat, cycle_t *tsc_lat)
 +{
++/* XEN paravirtualization does not seem to like the rdtscll call, and redefines
++ * it in parvirt.h. It is a bit dodgy but allow compilation ... and not used so
++ * far, it is more a record what should be done.
++ */
++#ifdef CONFIG_PARAVIRT
++#define real_rdtscll(val) (val = __native_read_tsc())
++#else
++#define real_rdtscll(val) rdtscll(val)
++#endif
 +	vcounter_t vcount;
 +	cycle_t tsc1, tsc2, tsc3;
 +

+	if (likely(gtod->sysctl_enabled && gtod->clock.vread)) {
+
+		/* One for fun and warmup */
+		rdtscll(tsc1);
+		__asm __volatile("lfence" ::: "memory");
+		rdtscll(tsc1);
+		__asm __volatile("lfence" ::: "memory");
+		rdtscll(tsc2);
+		__asm __volatile("lfence" ::: "memory");
+		vcount = read_vcounter();
+		__asm __volatile("lfence" ::: "memory");
+		rdtscll(tsc3);
+		__asm __volatile("lfence" ::: "memory");
+
+		*vcounter = vcount;

---
 arch/x86/include/asm/vgtod.h   |    4 ++
 arch/x86/kernel/vsyscall_64.c  |    4 ++
 arch/x86/vdso/vclock_gettime.c |   87 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 95 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index dc27a69..685f7a9 100644
