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

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

 



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;

--
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