4 static inline unsigned long long rdtsc()
11 asm volatile ("rdtsc" : "=a"(a
), "=d"(d
));
12 r
= a
| ((long long)d
<< 32);
14 asm volatile ("rdtsc" : "=A"(r
));
30 unsigned long long t1
, t2
;
33 for (i
= 0; i
< N
; ++i
)
34 asm volatile ("push %%"R
"bx; cpuid; pop %%"R
"bx"
35 : : : "eax", "ecx", "edx");
37 printf("vmexit latency: %d\n", (int)((t2
- t1
) / N
));