Re: kvm/ia64: Fix halt emulation logic.

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

 



Hi Xiantao,

On Wed, Oct 15, 2008 at 09:47:24PM +0800, Zhang, Xiantao wrote:
> +		expires = div64_u64(itc_diff, cyc_per_usec);
> +		kt = ktime_set(0, 1000 * expires);
> +
> +		down_read(&vcpu->kvm->slots_lock);
> +		vcpu->arch.ht_active = 1;
> +		hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS);
>  
> -	if (irqchip_in_kernel(vcpu->kvm)) {
>  		vcpu->arch.mp_state = KVM_MP_STATE_HALTED;
>  		kvm_vcpu_block(vcpu);
>  		hrtimer_cancel(p_ht);
>  		vcpu->arch.ht_active = 0;
>  
> +		if (test_and_clear_bit(KVM_REQ_UNHALT, &vcpu->requests))
> +			if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED)
> +				vcpu->arch.mp_state =
> +					KVM_MP_STATE_RUNNABLE;
> +		up_read(&vcpu->kvm->slots_lock);

You should release slots_lock when blocking via kvm_vcpu_block().
Otherwise paths that grab it for write will depend on these vcpus to
unhalt.

BTW, none of the data structures in this section of code should be
protected by slots_lock?
--
To unsubscribe from this list: send the line "unsubscribe kvm-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux KVM Devel]     [Linux Virtualization]     [Big List of Linux Books]     [Linux SCSI]     [Yosemite Forum]

  Powered by Linux