From patchwork Thu Jul 31 09:47:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 4654521 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 19E46C0338 for ; Thu, 31 Jul 2014 09:48:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42B27201C0 for ; Thu, 31 Jul 2014 09:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65457201C8 for ; Thu, 31 Jul 2014 09:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932413AbaGaJsk (ORCPT ); Thu, 31 Jul 2014 05:48:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28362 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932313AbaGaJsj (ORCPT ); Thu, 31 Jul 2014 05:48:39 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6V9mUG4011520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 31 Jul 2014 05:48:30 -0400 Received: from dell-pet610-01.lab.eng.brq.redhat.com (dell-pet610-01.lab.eng.brq.redhat.com [10.34.42.20]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6V9mNb7011115; Thu, 31 Jul 2014 05:48:28 -0400 From: Igor Mammedov To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, hpa@zytor.com, mingo@redhat.com, tglx@linutronix.de, pbonzini@redhat.com, kvm@vger.kernel.org, mtosatti@redhat.com Subject: [PATCH 2/2] x86: kvm: do not advertise stable clocksource if CPU has TSC drift BUG Date: Thu, 31 Jul 2014 09:47:13 +0000 Message-Id: <1406800033-13404-3-git-send-email-imammedo@redhat.com> In-Reply-To: <1406800033-13404-1-git-send-email-imammedo@redhat.com> References: <1406800033-13404-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Igor Mammedov --- arch/x86/kvm/cpuid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 38a0afe..f519823 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -478,8 +478,9 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, (1 << KVM_FEATURE_CLOCKSOURCE2) | (1 << KVM_FEATURE_ASYNC_PF) | (1 << KVM_FEATURE_PV_EOI) | - (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT) | (1 << KVM_FEATURE_PV_UNHALT); + if (!static_cpu_has_bug(X86_BUG_AMD_TSC_DRIFT)) + entry->eax |= (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT); if (sched_info_on()) entry->eax |= (1 << KVM_FEATURE_STEAL_TIME);