Messages in this thread Patch in this message | | | Date | Thu, 21 May 2015 21:40:08 -0300 | From | Marcelo Tosatti <> | Subject | KVM: x86: zero kvmclock_offset when vcpu0 initializes kvmclock system MSR |
| |
Initialize kvmclock base, on kvmclock system MSR write time, so that the guest sees kvmclock counting from zero.
This matches baremetal behaviour when kvmclock in guest sets sched clock stable.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cc2c759..ea40d24 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2188,6 +2188,8 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) &vcpu->requests); ka->boot_vcpu_runs_old_kvmclock = tmp; + + ka->kvmclock_offset = get_kernel_ns(); } vcpu->arch.time = data;
| |