diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:25 -0500 |
commit | cc4529efc7b730b596d9c7d5a917c00a357e92aa (patch) | |
tree | b62836e2986bc1d7583de50158f1933e9f65784b /drivers | |
parent | 697fe2e24ac49f03a82f6cfe5d77f7a2122ff382 (diff) |
[PATCH] KVM: MMU: kvm_mmu_put_page() only removes one link to the page
... and so must not free it unconditionally.
Move the freeing to kvm_mmu_zap_page().
Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/kvm/mmu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 7e20dbf4f84c..d788866d5a6f 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -521,10 +521,6 @@ static void kvm_mmu_put_page(struct kvm_vcpu *vcpu, | |||
521 | u64 *parent_pte) | 521 | u64 *parent_pte) |
522 | { | 522 | { |
523 | mmu_page_remove_parent_pte(page, parent_pte); | 523 | mmu_page_remove_parent_pte(page, parent_pte); |
524 | kvm_mmu_page_unlink_children(vcpu, page); | ||
525 | hlist_del(&page->hash_link); | ||
526 | list_del(&page->link); | ||
527 | list_add(&page->link, &vcpu->free_pages); | ||
528 | } | 524 | } |
529 | 525 | ||
530 | static void kvm_mmu_zap_page(struct kvm_vcpu *vcpu, | 526 | static void kvm_mmu_zap_page(struct kvm_vcpu *vcpu, |
@@ -546,6 +542,10 @@ static void kvm_mmu_zap_page(struct kvm_vcpu *vcpu, | |||
546 | kvm_mmu_put_page(vcpu, page, parent_pte); | 542 | kvm_mmu_put_page(vcpu, page, parent_pte); |
547 | *parent_pte = 0; | 543 | *parent_pte = 0; |
548 | } | 544 | } |
545 | kvm_mmu_page_unlink_children(vcpu, page); | ||
546 | hlist_del(&page->hash_link); | ||
547 | list_del(&page->link); | ||
548 | list_add(&page->link, &vcpu->free_pages); | ||
549 | } | 549 | } |
550 | 550 | ||
551 | static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) | 551 | static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) |