 +
 +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;

 }
 
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
index 6a40b78..656b941 100644
--- a/arch/x86/vdso/vclock_gettime.c
+++ b/arch/x86/vdso/vclock_gettime.c
@@ -124,3 +124,90 @@ notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
 }
 int gettimeofday(struct timeval *, struct timezone *)
 	__attribute__((weak, alias("__vdso_gettimeofday")));
