From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: KVM: x86: disable kvmclock on non constant TSC hosts Date: Tue, 10 Feb 2009 15:24:07 -0200 Message-ID: <20090210172407.GA31394@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Glauber de Oliveira Costa , kvm-devel To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:40461 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753434AbZBJRYc (ORCPT ); Tue, 10 Feb 2009 12:24:32 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1AHOVhk030123 for ; Tue, 10 Feb 2009 12:24:31 -0500 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Currently, this code path is posing us big troubles, and we won't have a decent patch in time. So, temporarily disable it. There's a module parameter for the adventurous who want to force it. Signed-off-by: Glauber Costa Signed-off-by: Marcelo Tosatti --- arch/x86/kvm/x86.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e96edda..6286f08 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -979,6 +979,9 @@ out: return r; } +static int force_kvmclock = 0; +module_param(force_kvmclock, bool, 0644); + int kvm_dev_ioctl_check_extension(long ext) { int r; @@ -989,7 +992,6 @@ int kvm_dev_ioctl_check_extension(long ext) case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: case KVM_CAP_SET_TSS_ADDR: case KVM_CAP_EXT_CPUID: - case KVM_CAP_CLOCKSOURCE: case KVM_CAP_PIT: case KVM_CAP_NOP_IO_DELAY: case KVM_CAP_MP_STATE: @@ -1015,6 +1017,9 @@ int kvm_dev_ioctl_check_extension(long ext) case KVM_CAP_IOMMU: r = iommu_found(); break; + case KVM_CAP_CLOCKSOURCE: + r = force_kvmclock || boot_cpu_has(X86_FEATURE_CONSTANT_TSC); + break; default: r = 0; break;