Re: [PATCH] x86/vmware: Skip lapic calibration on VMware.

From
Thomas Gleixner <hidden>
Date
2016-09-30 08:55:42
Also in
lkml
On Thu, 29 Sep 2016, Renat Valiullin wrote:
In virtualized environment the APIC timer calibration could go wrong
when the host is overcommitted or the guest is running nested,
this would result in the APIC timers operating at an incorrect frequency.
Since VMware supports a mechanism to retrieve the local APIC frequency
we can ask the hypervisor for it and skip this APIC calibration loop.

Signed-off-by: Renat Valiullin <redacted>
Acked-by: Alok N Kataria <redacted>
---
 arch/x86/kernel/cpu/vmware.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
Please fix your mail client so it does not mangle the patch into DOS
format. Aside of that it's white space mangled, i.e. the tabs are converted
to spaces.
 
Please send your patch to yourself, export it to a mbox and apply it with
git am.
quoted hunk
-       if (ebx != UINT_MAX)
+       if (ebx != UINT_MAX) {
                x86_platform.calibrate_tsc = vmware_get_tsc_khz;
-       else
+#ifdef CONFIG_X86_LOCAL_APIC
+               /* Skip lapic calibration since we know the bus frequency. */
+               lapic_timer_frequency = ecx / HZ;
+               pr_info("Host bus clock speed read from hypervisor : %u Hz\n",
+                       ecx);
+#endif
+       } else
                pr_warn("Failed to get TSC freq from the hypervisor\n");
Please add braces around this as well. See Documentation/Codingstyle

Thanks,

	tglx

Attachments

Thread (1 message) 1 message, 1 author, last reply 2016-09-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help