aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r--drivers/kvm/mmu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index d81b9cd3465f..376800a33968 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -1314,6 +1314,23 @@ void kvm_mmu_slot_remove_write_access(struct kvm_vcpu *vcpu, int slot)
1314 } 1314 }
1315} 1315}
1316 1316
1317void kvm_mmu_zap_all(struct kvm_vcpu *vcpu)
1318{
1319 destroy_kvm_mmu(vcpu);
1320
1321 while (!list_empty(&vcpu->kvm->active_mmu_pages)) {
1322 struct kvm_mmu_page *page;
1323
1324 page = container_of(vcpu->kvm->active_mmu_pages.next,
1325 struct kvm_mmu_page, link);
1326 kvm_mmu_zap_page(vcpu, page);
1327 }
1328
1329 mmu_free_memory_caches(vcpu);
1330 kvm_arch_ops->tlb_flush(vcpu);
1331 init_kvm_mmu(vcpu);
1332}
1333
1317#ifdef AUDIT 1334#ifdef AUDIT
1318 1335
1319static const char *audit_msg; 1336static const char *audit_msg;