diff options
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/tsc.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h index 0181f9df7539..3f3c1fa000b4 100644 --- a/include/asm-i386/tsc.h +++ b/include/asm-i386/tsc.h | |||
@@ -38,6 +38,15 @@ static __always_inline cycles_t get_cycles_sync(void) | |||
38 | unsigned eax; | 38 | unsigned eax; |
39 | 39 | ||
40 | /* | 40 | /* |
41 | * Use RDTSCP if possible; it is guaranteed to be synchronous | ||
42 | * and doesn't cause a VMEXIT on Hypervisors | ||
43 | */ | ||
44 | alternative_io(ASM_NOP3, ".byte 0x0f,0x01,0xf9", X86_FEATURE_RDTSCP, | ||
45 | "=A" (ret), "0" (0ULL) : "ecx", "memory"); | ||
46 | if (ret) | ||
47 | return ret; | ||
48 | |||
49 | /* | ||
41 | * Don't do an additional sync on CPUs where we know | 50 | * Don't do an additional sync on CPUs where we know |
42 | * RDTSC is already synchronous: | 51 | * RDTSC is already synchronous: |
43 | */ | 52 | */ |