public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
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	[thread overview]
Message-ID: <1406800033-13404-3-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1406800033-13404-1-git-send-email-imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 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);
-- 
1.8.3.1

  parent reply	other threads:[~2014-07-31  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31  9:47 [PATCH 0/2] Avoid using TSC clocksource on AMD APUs affected by erratum 778 Igor Mammedov
2014-07-31  9:47 ` [PATCH 1/2] x86: AMD: mark TSC unstable on APU family 15h models 10h-1fh Igor Mammedov
2014-07-31 15:47   ` Borislav Petkov
2014-07-31 16:33     ` Paolo Bonzini
2014-08-01  9:02   ` Borislav Petkov
2014-07-31  9:47 ` Igor Mammedov [this message]
2014-07-31 14:38   ` [PATCH 2/2] x86: kvm: do not advertise stable clocksource if CPU has TSC drift BUG Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406800033-13404-3-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox