aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/vmware.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/vmware.c')
-rw-r--r--arch/x86/kernel/cpu/vmware.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d5d1b75a4b77..2ac4394fcb90 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -86,3 +86,21 @@ unsigned long vmware_get_tsc_khz(void)
86 BUG_ON(!vmware_platform()); 86 BUG_ON(!vmware_platform());
87 return __vmware_get_tsc_khz(); 87 return __vmware_get_tsc_khz();
88} 88}
89
90/*
91 * VMware hypervisor takes care of exporting a reliable TSC to the guest.
92 * Still, due to timing difference when running on virtual cpus, the TSC can
93 * be marked as unstable in some cases. For example, the TSC sync check at
94 * bootup can fail due to a marginal offset between vcpus' TSCs (though the
95 * TSCs do not drift from each other). Also, the ACPI PM timer clocksource
96 * is not suitable as a watchdog when running on a hypervisor because the
97 * kernel may miss a wrap of the counter if the vcpu is descheduled for a
98 * long time. To skip these checks at runtime we set these capability bits,
99 * so that the kernel could just trust the hypervisor with providing a
100 * reliable virtual TSC that is suitable for timekeeping.
101 */
102void __cpuinit vmware_set_feature_bits(struct cpuinfo_x86 *c)
103{
104 set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
105 set_cpu_cap(c, X86_FEATURE_TSC_RELIABLE);
106}