Commit 436e5a3a authored by Herongguang (Stephen)'s avatar Herongguang (Stephen) Committed by Kleber Sacilotto de Souza

KVM: pci-assign: do not map smm memory slot pages in vt-d page tables

BugLink: http://bugs.launchpad.net/bugs/1745054

[ Upstream commit 0292e169 ]

or VM memory are not put thus leaked in kvm_iommu_unmap_memslots() when
destroy VM.

This is consistent with current vfio implementation.
Signed-off-by: default avatarherongguang <herongguang.he@huawei.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent ed83d7c5
...@@ -986,7 +986,7 @@ int __kvm_set_memory_region(struct kvm *kvm, ...@@ -986,7 +986,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
* changes) is disallowed above, so any other attribute changes getting * changes) is disallowed above, so any other attribute changes getting
* here can be skipped. * here can be skipped.
*/ */
if ((change == KVM_MR_CREATE) || (change == KVM_MR_MOVE)) { if (as_id == 0 && (change == KVM_MR_CREATE || change == KVM_MR_MOVE)) {
r = kvm_iommu_map_pages(kvm, &new); r = kvm_iommu_map_pages(kvm, &new);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment