]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: Fix iommu map/unmap to handle memory slot moves
authorAlex Williamson <alex.williamson@redhat.com>
Mon, 10 Dec 2012 17:32:57 +0000 (10:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 18:50:34 +0000 (10:50 -0800)
commit5833570f8e15cd7a40dd6c14ec73cb53736048cf
tree3fd955b0612b7f75f60e71994fb3d5a79e8b79a5
parent9af88f0e8b1ce5f10786654c3f00adde1c67a2e5
KVM: Fix iommu map/unmap to handle memory slot moves

commit e40f193f5bb022e927a57a4f5d5194e4f12ddb74 upstream.

The iommu integration into memory slots expects memory slots to be
added or removed and doesn't handle the move case.  We can unmap
slots from the iommu after we mark them invalid and map them before
installing the final memslot array.  Also re-order the kmemdup vs
map so we don't leave iommu mappings if we get ENOMEM.

Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
virt/kvm/kvm_main.c