mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] KVM: MMU: Free pages on kvm destruction
Because mmu pages have attached rmap and parent pte chain structures, we need to zap them before freeing so the attached structures are freed. Signed-off-by: Avi Kivity <[email protected]> Acked-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
143646567f
commit
f51234c2cd
1 changed files with 7 additions and 2 deletions
|
|
@ -1065,9 +1065,14 @@ EXPORT_SYMBOL_GPL(kvm_mmu_free_some_pages);
|
|||
|
||||
static void free_mmu_pages(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
while (!list_empty(&vcpu->free_pages)) {
|
||||
struct kvm_mmu_page *page;
|
||||
struct kvm_mmu_page *page;
|
||||
|
||||
while (!list_empty(&vcpu->kvm->active_mmu_pages)) {
|
||||
page = container_of(vcpu->kvm->active_mmu_pages.next,
|
||||
struct kvm_mmu_page, link);
|
||||
kvm_mmu_zap_page(vcpu, page);
|
||||
}
|
||||
while (!list_empty(&vcpu->free_pages)) {
|
||||
page = list_entry(vcpu->free_pages.next,
|
||||
struct kvm_mmu_page, link);
|
||||
list_del(&page->link);
|
||||
|
|
|
|||
Loading…
Reference in a new issue