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