diff options
author | Avi Kivity <avi@qumranet.com> | 2007-05-06 08:36:30 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-07-16 05:05:40 -0400 |
commit | 4b02d6daa12465b209ec4f50c363f9553a51f45b (patch) | |
tree | bf88d7f3bfea2851ba5d7f4b67bef1eee9c2ea48 /drivers/kvm/mmu.c | |
parent | 2dc7094b5662c4446aa647b257d47a9412fbacc9 (diff) |
KVM: MMU: Simplify kvm_mmu_free_page() a tiny bit
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r-- | drivers/kvm/mmu.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 9ec3df90dbb8..a96c9ae54f3c 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -455,12 +455,10 @@ static int is_empty_shadow_page(hpa_t page_hpa) | |||
455 | } | 455 | } |
456 | #endif | 456 | #endif |
457 | 457 | ||
458 | static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, hpa_t page_hpa) | 458 | static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, |
459 | struct kvm_mmu_page *page_head) | ||
459 | { | 460 | { |
460 | struct kvm_mmu_page *page_head = page_header(page_hpa); | 461 | ASSERT(is_empty_shadow_page(page_head->page_hpa)); |
461 | |||
462 | ASSERT(is_empty_shadow_page(page_hpa)); | ||
463 | page_head->page_hpa = page_hpa; | ||
464 | list_move(&page_head->link, &vcpu->free_pages); | 462 | list_move(&page_head->link, &vcpu->free_pages); |
465 | ++vcpu->kvm->n_free_mmu_pages; | 463 | ++vcpu->kvm->n_free_mmu_pages; |
466 | } | 464 | } |
@@ -690,7 +688,7 @@ static void kvm_mmu_zap_page(struct kvm_vcpu *vcpu, | |||
690 | kvm_mmu_page_unlink_children(vcpu, page); | 688 | kvm_mmu_page_unlink_children(vcpu, page); |
691 | if (!page->root_count) { | 689 | if (!page->root_count) { |
692 | hlist_del(&page->hash_link); | 690 | hlist_del(&page->hash_link); |
693 | kvm_mmu_free_page(vcpu, page->page_hpa); | 691 | kvm_mmu_free_page(vcpu, page); |
694 | } else | 692 | } else |
695 | list_move(&page->link, &vcpu->kvm->active_mmu_pages); | 693 | list_move(&page->link, &vcpu->kvm->active_mmu_pages); |
696 | } | 694 | } |