Re: [RFC PATCH v3 2/2] add support for Hyper-V partition reference time enlightenment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 11/12/2013 20:27, Marcelo Tosatti ha scritto:
>> > +		if (kvm->arch.hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) {
>> > +			HV_REFERENCE_TSC_PAGE* tsc_ref;
>> > +			tsc_ref = (HV_REFERENCE_TSC_PAGE*)gfn_to_hva(kvm,
>> > +				kvm->arch.hv_tsc_page >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT);
> kvm_read_guest_cached.
> 
>> > +			kvm->arch.hv_ref_time = (((tsc_ref->tsc_scale >> 32) * 
>> > +				native_read_tsc()) >> 32) + tsc_ref->tsc_offset;
> Why native_read_tsc and not ->read_l1_tsc?
> 
> It is easier to trust on the host to check reliability of the TSC: if
> it uses TSC clocksource, then the TSCs are stable. So could condition
> exposing the TSC ref page when ka->use_master_clock=1, see kvm_guest_time_update.
> And hook into pvclock_gtod_notify.
> 
> So in addition to X86_FEATURE_CONSTANT_TSC, check
> ka->use_master_clock=1

FWIW, I agree with all these comments from Marcelo.

Paolo

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux