summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorHerongguang (Stephen) <herongguang.he@huawei.com>2017-03-27 15:21:17 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-25 14:22:13 +0100
commitf15394085d11c01a9b2a362068182b47b17e2fbe (patch)
treeb1ca1c2915d5a27d691f7c4e4d2ece034ef6eba9 /virt
parent27c2fa1ae0ea735b32376777f012ab92c4ee8650 (diff)
downloadlinux-stable-f15394085d11c01a9b2a362068182b47b17e2fbe.tar.gz
linux-stable-f15394085d11c01a9b2a362068182b47b17e2fbe.tar.bz2
linux-stable-f15394085d11c01a9b2a362068182b47b17e2fbe.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index cb092bd9965b..d080f06fd8d9 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -986,7 +986,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;
}