Re: [RFC PATCH 1/3] kvm/x86: remove KVM_REQ_PENDING_TIMER

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

 



On 23/07/2018 23:17, Isaku Yamahata wrote:
> -void kvm_set_pending_timer(struct kvm_vcpu *vcpu)
> -{
> -	/*
> -	 * Note: KVM_REQ_PENDING_TIMER is implicitly checked in
> -	 * vcpu_enter_guest.  This function is only called from
> -	 * the physical CPU that is running vcpu.
> -	 */
> -	kvm_make_request(KVM_REQ_PENDING_TIMER, vcpu);
> -}
> -
>  static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
>  {
>  	int version;
> @@ -7592,7 +7582,6 @@ static int vcpu_run(struct kvm_vcpu *vcpu)
>  		if (r <= 0)
>  			break;
>  
> -		kvm_clear_request(KVM_REQ_PENDING_TIMER, vcpu);
>  		if (kvm_cpu_has_pending_timer(vcpu))
>  			kvm_inject_pending_timer_irqs(vcpu);

The comment that you are removing is still true, however.  The bit is 
checked here:

        if (vcpu->mode == EXITING_GUEST_MODE || kvm_request_pending(vcpu)
            || need_resched() || signal_pending(current)) {

and your change is introducing a race when the preemption timer is not
in use.

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