summaryrefslogtreecommitdiff
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2008-07-10 20:49:31 -0300
committerAvi Kivity <avi@qumranet.com>2008-07-20 12:42:40 +0300
commit34d4cb8fca1f2a31be152b74797e6cd160ec9de6 (patch)
tree1e8f2c3c4feb54763fd0d8b27ef83ba546215069 /virt/kvm/kvm_main.c
parentd6e88aec07aa8f6c7e4024f5734ec659fd7c5a40 (diff)
downloadlinux-exynos-34d4cb8fca1f2a31be152b74797e6cd160ec9de6.tar.gz
linux-exynos-34d4cb8fca1f2a31be152b74797e6cd160ec9de6.tar.bz2
linux-exynos-34d4cb8fca1f2a31be152b74797e6cd160ec9de6.zip
KVM: MMU: nuke shadowed pgtable pages and ptes on memslot destruction
Flush the shadow mmu before removing regions to avoid stale entries. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 9ccaf8f5402e..30b36368fcdf 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -405,6 +405,9 @@ int __kvm_set_memory_region(struct kvm *kvm,
if (mem->slot >= kvm->nmemslots)
kvm->nmemslots = mem->slot + 1;
+ if (!npages)
+ kvm_arch_flush_shadow(kvm);
+
*memslot = new;
r = kvm_arch_set_memory_region(kvm, mem, old, user_alloc);