Re: [PATCH v8 11/13] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

From: Paolo Bonzini
Date: Wed Sep 16 2015 - 05:32:23 EST




On 16/09/2015 10:50, Feng Wu wrote:
> * are two possible cases:
> - * 1. After running 'pi_pre_block', context switch
> + * 1. After running 'pre_block', context switch

Please fold this in the previous patch.

> * happened. For this case, 'sn' was set in
> * vmx_vcpu_put(), so we need to clear it here.
> - * 2. After running 'pi_pre_block', we were blocked,
> + * 2. After running 'pre_block', we were blocked,
> * and woken up by some other guy. For this case,

(Same).

> + spin_lock(&per_cpu(blocked_vcpu_on_cpu_lock, cpu));
> + list_for_each_entry(vcpu, &per_cpu(blocked_vcpu_on_cpu, cpu),
> + blocked_vcpu_list) {
> + struct pi_desc *pi_desc = vcpu_to_pi_desc(vcpu);
> +
> + if (pi_test_on(pi_desc) == 1)
> + kvm_vcpu_kick(vcpu);
> + }
> + spin_unlock(&per_cpu(blocked_vcpu_on_cpu_lock, cpu));
> +}

Please document the lock in Documentation/virtual/kvm/locking.txt.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/