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" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to