Re: [patch 4/8] KVM: x86: replace hrtimer based timer emulation

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

 



Excellent patch series.

On Sun, Jul 05, 2009 at 10:55:15PM -0300, Marcelo Tosatti wrote:
>  int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
>  {
> -	int ret;
> +	ktime_t now, expires;
>  
> -	ret = pit_has_pending_timer(vcpu);
> -	ret |= apic_has_pending_timer(vcpu);
> +	expires = kvm_vcpu_next_timer_event(vcpu);
> +	now = ktime_get();
> +	if (expires.tv64 <= now.tv64) {
> +		if (kvm_arch_interrupt_allowed(vcpu))
> +			set_bit(KVM_REQ_UNHALT, &vcpu->requests);
You shouldn't unhalt vcpu here. Not every timer event will generate
interrupt (vector can be masked in pic/ioapic) or timer event can
generate NMI instead of interrupt. Leaving this code out probably means
that you can't remove kvm_inject_pending_timer_irqs() call from
__vcpu_run().

> +		return 1;
> +	}
>  
> -	return ret;
> +	return 0;
>  }
>  EXPORT_SYMBOL(kvm_cpu_has_pending_timer);
>  

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