Re: [PATCH v2] KVM: x86: allow TSC to differ by NTP correction bounds without TSC scaling

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

 



On 16/06/20 13:47, Marcelo Tosatti wrote:
> v2: improve changelog (Paolo Bonzini)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 3156e25..39a6664 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1772,6 +1772,8 @@ static int set_tsc_khz(struct kvm_vcpu *vcpu, u32 user_tsc_khz, bool scale)
>  
>  	/* TSC scaling supported? */
>  	if (!kvm_has_tsc_control) {
> +		if (!scale)
> +			return 0;

This cannot happen, there is an "if (!scale) right above.

>  		if (user_tsc_khz > tsc_khz) {
>  			vcpu->arch.tsc_catchup = 1;
>  			vcpu->arch.tsc_always_catchup = 1;
> @@ -4473,7 +4475,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  		r = -EINVAL;
>  		user_tsc_khz = (u32)arg;
>  
> -		if (user_tsc_khz >= kvm_max_guest_tsc_khz)
> +		if (kvm_has_tsc_control &&
> +		    user_tsc_khz >= kvm_max_guest_tsc_khz)
>  			goto out;
>  
>  		if (user_tsc_khz == 0)
> 

Queued this second hunk.

Paolo




[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