Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759066AbcJ1HzR (ORCPT ); Fri, 28 Oct 2016 03:55:17 -0400 Received: from ex13-edg-ou-001.vmware.com ([208.91.0.189]:33174 "EHLO EX13-EDG-OU-001.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755231AbcJ1Hyv (ORCPT ); Fri, 28 Oct 2016 03:54:51 -0400 From: Alexey Makhalov To: , , , , , CC: , , , , Alexey Makhalov Subject: [PATCH v3 1/3] x86/vmware: Use tsc_khz value for calibrate_cpu() Date: Fri, 28 Oct 2016 00:54:30 -0700 Message-ID: <20161028075432.90579-2-amakhalov@vmware.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20161028075432.90579-1-amakhalov@vmware.com> References: <20161028075432.90579-1-amakhalov@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1110 Lines: 30 Commit aa297292d708 ("x86/tsc: Enumerate SKL cpu_khz and tsc_khz via CPUID") separated the calibration mechanisms for cpu_khz and tsc_khz. Since the vmware hypervisor provides a constant frequency TSC to the guest, this change can lead to divergence between the tsc and the cpu frequency after vmotion, which might confuse the user. Solve this by overriding the x86 platform cpu calibration callback with the vmware specific tsc calibration function. Signed-off-by: Alexey Makhalov Acked-by: Alok N Kataria --- arch/x86/kernel/cpu/vmware.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 4e34da4b..480790f 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -83,6 +83,7 @@ static void __init vmware_platform_setup(void) vmware_tsc_khz = tsc_khz; x86_platform.calibrate_tsc = vmware_get_tsc_khz; + x86_platform.calibrate_cpu = vmware_get_tsc_khz; #ifdef CONFIG_X86_LOCAL_APIC /* Skip lapic calibration since we know the bus frequency. */ -- 2.10.1