KVM: Fix assigned devices circular locking dependency
authorMark McLoughlin <markmc@redhat.com>
Thu, 5 Feb 2009 18:23:46 +0000 (18:23 +0000)
committerAvi Kivity <avi@redhat.com>
Sun, 15 Feb 2009 00:47:39 +0000 (02:47 +0200)
commit682edb4c01e690c7c7cd772dbd6f4e0fd74dc572
tree21e41d8f67f3fc81df9744e91350e76b1787ec3b
parentb682b814e3cc340f905c14dff87ce8bdba7c5eba
KVM: Fix assigned devices circular locking dependency

kvm->slots_lock is outer to kvm->lock, so take slots_lock
in kvm_vm_ioctl_assign_device() before taking kvm->lock,
rather than taking it in kvm_iommu_map_memslots().

Cc: stable@kernel.org
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
virt/kvm/iommu.c
virt/kvm/kvm_main.c