]> git.baikalelectronics.ru Git - kernel.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)
committerMarcelo Tosatti <mtosatti@redhat.com>
Fri, 14 Dec 2012 01:21:52 +0000 (23:21 -0200)
commitdd4d28b7fadd413903fa9ee031ad48d44119e111
treeb40ba3bafaf75eb6f27e41164b213cda708c7605
parent081d42e456cbea99d2e1029bb94716692895aa87
KVM: Fix iommu map/unmap to handle memory slot moves

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>
virt/kvm/kvm_main.c