kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KVM: x86: update masterclock when kvmclock_offset is calculated
@ 2013-08-20 18:20 Marcelo Tosatti
  2013-08-22 17:05 ` Paolo Bonzini
  0 siblings, 1 reply; 12+ messages in thread
From: Marcelo Tosatti @ 2013-08-20 18:20 UTC (permalink / raw)
  To: kvm-devel; +Cc: Paolo Bonzini, Gleb Natapov


The offset to add to the hosts monotonic time, kvmclock_offset, is
calculated against the monotonic time at KVM_SET_CLOCK ioctl time.

Request a master clock update at this time, to reduce a potentially
unbounded difference between the values of the masterclock and
the clock value used to calculate kvmclock_offset.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Index: linux-2.6-kvmclock-fixes/arch/x86/kvm/x86.c
===================================================================
--- linux-2.6-kvmclock-fixes.orig/arch/x86/kvm/x86.c
+++ linux-2.6-kvmclock-fixes/arch/x86/kvm/x86.c
@@ -3806,6 +3806,7 @@ long kvm_arch_vm_ioctl(struct file *filp
 		delta = user_ns.clock - now_ns;
 		local_irq_enable();
 		kvm->arch.kvmclock_offset = delta;
+		kvm_gen_update_masterclock(kvm);
 		break;
 	}
 	case KVM_GET_CLOCK: {

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-03 14:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-20 18:20 KVM: x86: update masterclock when kvmclock_offset is calculated Marcelo Tosatti
2013-08-22 17:05 ` Paolo Bonzini
2013-08-23 10:00   ` Paolo Bonzini
2013-08-28  2:55     ` KVM: x86: update masterclock when kvmclock_offset is calculated (v2) Marcelo Tosatti
2013-08-28 14:47       ` Gleb Natapov
2013-08-28  2:55     ` KVM: x86: update masterclock when kvmclock_offset is calculated Marcelo Tosatti
2013-08-28  2:52   ` Marcelo Tosatti
2013-08-28 12:37     ` Paolo Bonzini
2013-09-03  3:03       ` Marcelo Tosatti
2013-09-03 10:42         ` Paolo Bonzini
2013-09-03 13:56           ` Marcelo Tosatti
2013-09-03 14:20             ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).