summaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorHerongguang (Stephen) <herongguang.he@huawei.com>2017-03-27 15:21:17 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-03-28 10:08:54 +0200
commit0292e169b2d9c8377a168778f0b16eadb1f578fd (patch)
treecbe2ed3445aa765e31b22b41104342929c43f93d /virt/kvm
parent90db10434b163e46da413d34db8d0e77404cc645 (diff)
downloadop-kernel-dev-0292e169b2d9c8377a168778f0b16eadb1f578fd.zip
op-kernel-dev-0292e169b2d9c8377a168778f0b16eadb1f578fd.tar.gz
KVM: pci-assign: do not map smm memory slot pages in vt-d page tables
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: herongguang <herongguang.he@huawei.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ef1aa7f..88257b3 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1065,7 +1065,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
* changes) is disallowed above, so any other attribute changes getting
* 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);
return r;
}
OpenPOWER on IntegriCloud