From: Alex Williamson Date: Wed, 18 Apr 2012 03:46:44 +0000 (-0600) Subject: KVM: lock slots_lock around device assignment X-Git-Tag: v3.4-rc4~25^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21a1416a1c945c5aeaeaf791b63c64926018eb77;p=pandora-kernel.git KVM: lock slots_lock around device assignment As pointed out by Jason Baron, when assigning a device to a guest we first set the iommu domain pointer, which enables mapping and unmapping of memory slots to the iommu. This leaves a window where this path is enabled, but we haven't synchronized the iommu mappings to the existing memory slots. Thus a slot being removed at that point could send us down unexpected code paths removing non-existent pinnings and iommu mappings. Take the slots_lock around creating the iommu domain and initial mappings as well as around iommu teardown to avoid this race. Signed-off-by: Alex Williamson Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed