All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: unmap SMM memslots in vt-d table
@ 2017-03-25 11:14 ` herongguang
  0 siblings, 0 replies; 13+ messages in thread
From: herongguang @ 2017-03-25 11:14 UTC (permalink / raw)
  To: pbonzini, rkrcmar, kvm; +Cc: qemu-devel, wangxinxin.wang, herongguang.he

or pages are not unmaped and freed

Signed-off-by: herongguang <herongguang.he@huawei.com>
---
 arch/x86/kvm/iommu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Well, do we should change pci-assign to not map SMM slots instead? Like vfio.
 
diff --git a/arch/x86/kvm/iommu.c b/arch/x86/kvm/iommu.c
index b181426..5b931bb 100644
--- a/arch/x86/kvm/iommu.c
+++ b/arch/x86/kvm/iommu.c
@@ -320,15 +320,17 @@ void kvm_iommu_unmap_pages(struct kvm *kvm, struct kvm_memory_slot *slot)
 static int kvm_iommu_unmap_memslots(struct kvm *kvm)
 {
 	int idx;
-	struct kvm_memslots *slots;
+	struct kvm_memslots *slots, *smm_slots;
 	struct kvm_memory_slot *memslot;
 
 	idx = srcu_read_lock(&kvm->srcu);
 	slots = kvm_memslots(kvm);
-
 	kvm_for_each_memslot(memslot, slots)
 		kvm_iommu_unmap_pages(kvm, memslot);
 
+	smm_slots = __kvm_memslots(kvm, 1);
+	kvm_for_each_memslot(memslot, smm_slots)
+		kvm_iommu_unmap_pages(kvm, memslot);
 	srcu_read_unlock(&kvm->srcu, idx);
 
 	if (kvm->arch.iommu_noncoherent)
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-03-28  8:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-25 11:14 [PATCH] KVM: unmap SMM memslots in vt-d table herongguang
2017-03-25 11:14 ` [Qemu-devel] " herongguang
2017-03-27  7:21 ` [PATCH v2] KVM: pci-assign: do not map smm memory slot pages Herongguang (Stephen)
2017-03-27  7:21   ` [Qemu-devel] " Herongguang (Stephen)
2017-03-27 11:53   ` Paolo Bonzini
2017-03-27 11:53     ` [Qemu-devel] " Paolo Bonzini
2017-03-27 12:22   ` Paolo Bonzini
2017-03-27 12:22     ` [Qemu-devel] " Paolo Bonzini
2017-03-27 12:58     ` hrg
2017-03-28  1:08     ` Herongguang (Stephen)
2017-03-28  1:08       ` [Qemu-devel] " Herongguang (Stephen)
2017-03-28  8:09       ` Paolo Bonzini
2017-03-28  8:09         ` [Qemu-devel] " Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.