KVM: vgic: Use wrapper function to lock/unlock all vcpus in kvm_vgic_create()
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_loadis called which tries to grab the
*vcpu->mutex. By grabbing thevcpu->mutexof 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:Reviewed-by Steven Price <[email protected]>
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
-4ret = -EBUSY; - kvm_for_each_vcpu(i, vcpu, kvm) { - if (!mutex_trylock(&vcpu->mutex)) - goto out_unlock; - vcpu_lock_idx = i;