From: Paolo Bonzini <pbonzini@redhat.com>
To: Vadim Rozenfeld <vrozenfe@redhat.com>
Cc: kvm@vger.kernel.org, mtosatti@redhat.com, pl@dlhnet.de
Subject: Re: [RFC PATCH v4 2/2] add support for Hyper-V partition reference time enlightenment
Date: Tue, 14 Jan 2014 12:03:24 +0100 [thread overview]
Message-ID: <52D5197C.6090207@redhat.com> (raw)
In-Reply-To: <1389691337-12050-3-git-send-email-vrozenfe@redhat.com>
The cleanup between v3 and v4 is really nice; thanks. What happened to
the glitch you reported in the v3 thread.
Il 14/01/2014 10:22, Vadim Rozenfeld ha scritto:
> + tsc_ref.tsc_scale = ((10000LL << 32) /
> + vcpu->arch.virtual_tsc_khz) << 32;
As mentioned in the review of v3, I don't really like the tsc_scale to
come from two different sources in the two cases of MSR write and
KVM_SET_CLOCK. This is the only qualm I still have with this patch.
Marcelo, do you have any ideas?
Paolo
> + tsc_ref.tsc_offset = kvm->arch.kvmclock_offset;
> + }
> if (__copy_to_user((void __user *)addr, &tsc_ref, sizeof(tsc_ref)))
> return 1;
> mark_page_dirty(kvm, gfn);
> @@ -3871,6 +3879,27 @@ long kvm_arch_vm_ioctl(struct file *filp,
> local_irq_enable();
> kvm->arch.kvmclock_offset = delta;
> kvm_gen_update_masterclock(kvm);
> + if (kvm->arch.hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) {
> + HV_REFERENCE_TSC_PAGE tsc_ref;
> + struct kvm_arch *ka = &kvm->arch;
> + r = kvm_read_guest(kvm, kvm->arch.hv_tsc_page,
> + &tsc_ref, sizeof(tsc_ref));
> + if (r)
> + goto out;
> + if (tsc_ref.tsc_sequence
> + && boot_cpu_has(X86_FEATURE_CONSTANT_TSC)
> + && ka->use_master_clock) {
> + tsc_ref.tsc_sequence++;
> + tsc_ref.tsc_scale = ((10000LL << 32) /
> + __get_cpu_var(cpu_tsc_khz)) << 32;
next prev parent reply other threads:[~2014-01-14 11:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-14 9:22 [RFC PATCH v4 0/2] Hyper-V timers Vadim Rozenfeld
2014-01-14 9:22 ` [RFC PATCH v4 1/2] add support for Hyper-V reference time counter Vadim Rozenfeld
2014-01-14 11:06 ` Paolo Bonzini
2014-01-14 9:22 ` [RFC PATCH v4 2/2] add support for Hyper-V partition reference time enlightenment Vadim Rozenfeld
2014-01-14 11:03 ` Paolo Bonzini [this message]
2014-01-14 19:10 ` Marcelo Tosatti
2014-01-14 19:20 ` Marcelo Tosatti
2014-01-16 13:53 ` 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=52D5197C.6090207@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pl@dlhnet.de \
--cc=vrozenfe@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.