Skip to contentSkip to conversation

KVM: vgic: Use wrapper function to lock/unlock all vcpus in kvm_vgic_create()

PATCH linmiaohe 1 participant 1 message Nov 28, 2019

Subsystems (2)
lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 8 lines · Steven Price

Review int kvm_vgic_create(struct kvm *kvm, u32 type)

Quoted 3 lines

if (irqchip_in_kernel(kvm))

(quoted diff) +0 -0
@@ -92,11 +92,8 @@ int kvm_vgic_create(struct kvm *kvm, u32 type)

Extra context:

/*
* Any time a vcpu is run, vcpu_load is called which tries to grab the
* vcpu->mutex. By grabbing the vcpu->mutex of all VCPUs we ensure

Quoted 7 lines

Review int kvm_vgic_create(struct kvm *kvm, u32 type) · line 93

Quoted 2 lines
(quoted diff) +0 -0
  	 * that no other VCPUs are run while we create the vgic.
  	 */

That comment no longer makes sense here - there's a very similar one already in lock_all_vcpus(). With that removed:

Many thanks for your review. That comment no longer makes sense as you figured out. I will remove that. Thanks again.

Quoted 5 lines
Quoted 5 lines
(quoted diff) +0 -4
  	ret = -EBUSY;
-	kvm_for_each_vcpu(i, vcpu, kvm) {
-		if (!mutex_trylock(&vcpu->mutex))
-			goto out_unlock;
-		vcpu_lock_idx = i;