diff options
author | Herongguang (Stephen) <herongguang.he@huawei.com> | 2017-03-27 15:21:17 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-25 14:23:42 +0100 |
commit | 808ed3bd9d42823e00ab2d3dc4c9899437fa3c8a (patch) | |
tree | f17e10ec46eba8fe34fd76cfcd4ec8e9a2564328 /virt | |
parent | 29c4f517ff5bb2f81750295418c8397755817d4c (diff) | |
download | linux-stable-808ed3bd9d42823e00ab2d3dc4c9899437fa3c8a.tar.gz linux-stable-808ed3bd9d42823e00ab2d3dc4c9899437fa3c8a.tar.bz2 linux-stable-808ed3bd9d42823e00ab2d3dc4c9899437fa3c8a.zip |
KVM: pci-assign: do not map smm memory slot pages in vt-d page tables
[ Upstream commit 0292e169b2d9c8377a168778f0b16eadb1f578fd ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4569fdcab701..68c078e47811 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1060,7 +1060,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; } |