summaryrefslogtreecommitdiffstats
path: root/virt/kvm/arm/vgic/vgic-init.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2017-06-15 09:35:15 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2017-06-15 09:35:15 +0100
commit6f2f10cabe73944488a62df16695c86e20d4c3f9 (patch)
tree514fa4c6127892ed55d5a00611ce95555c3ce011 /virt/kvm/arm/vgic/vgic-init.c
parentebb127f2d6f32665643165289151bd20929d9931 (diff)
parent33b5c38852b29736f3b472dd095c9a18ec22746f (diff)
downloadlinux-6f2f10cabe73944488a62df16695c86e20d4c3f9.tar.bz2
Merge branch 'kvmarm-master/master' into HEAD
Diffstat (limited to 'virt/kvm/arm/vgic/vgic-init.c')
-rw-r--r--virt/kvm/arm/vgic/vgic-init.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/virt/kvm/arm/vgic/vgic-init.c b/virt/kvm/arm/vgic/vgic-init.c
index dc68e2e424ab..3a0b8999f011 100644
--- a/virt/kvm/arm/vgic/vgic-init.c
+++ b/virt/kvm/arm/vgic/vgic-init.c
@@ -242,8 +242,11 @@ int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
* If we are creating a VCPU with a GICv3 we must also register the
* KVM io device for the redistributor that belongs to this VCPU.
*/
- if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3)
+ if (dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3) {
+ mutex_lock(&vcpu->kvm->lock);
ret = vgic_register_redist_iodev(vcpu);
+ mutex_unlock(&vcpu->kvm->lock);
+ }
return ret;
}