[PATCH v3 8/8] Tell the guest we'll warn it about tsc stability

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Glauber Costa
Date: Wednesday, May 5, 2010 - 2:27 pm

This patch puts up the flag that tells the guest that we'll warn it
about the tsc being trustworthy or not. By now, we also say
it is not.
---
 arch/x86/kvm/x86.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9295198..ddf997e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -855,6 +855,8 @@ static void kvm_write_guest_time(struct kvm_vcpu *v)
 	vcpu->hv_clock.system_time = ts.tv_nsec +
 				     (NSEC_PER_SEC * (u64)ts.tv_sec) + v->kvm->arch.kvmclock_offset;
 
+	vcpu->hv_clock.flags = 0;
+
 	/*
 	 * The interface expects us to write an even number signaling that the
 	 * update is finished. Since the guest won't see the intermediate
@@ -1983,7 +1985,8 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 	case KVM_CPUID_FEATURES:
 		entry->eax = (1 << KVM_FEATURE_CLOCKSOURCE) |
 			     (1 << KVM_FEATURE_NOP_IO_DELAY) |
-			     (1 << KVM_FEATURE_CLOCKSOURCE2);
+			     (1 << KVM_FEATURE_CLOCKSOURCE2) |
+			     (1 << KVM_FEATURE_CLOCKSOURCE_STABLE_BIT);
 		entry->ebx = 0;
 		entry->ecx = 0;
 		entry->edx = 0;
-- 
1.6.2.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v3 0/8] pvclock fixes - v3, Glauber Costa, (Wed May 5, 2:27 pm)
[PATCH v3 3/8] change msr numbers for kvmclock, Glauber Costa, (Wed May 5, 2:27 pm)
[PATCH v3 4/8] add new KVMCLOCK cpuid feature, Glauber Costa, (Wed May 5, 2:27 pm)
[PATCH v3 6/8] Try using new kvm clock msrs, Glauber Costa, (Wed May 5, 2:27 pm)
[PATCH v3 8/8] Tell the guest we'll warn it about tsc stab ..., Glauber Costa, (Wed May 5, 2:27 pm)