diff options
author | Avi Kivity <avi@qumranet.com> | 2007-05-31 08:08:29 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-07-16 05:05:43 -0400 |
commit | 97a0a01ea9229e4f3f0f06e0584227e9687159a5 (patch) | |
tree | 94ca92cafa05c7156757557466fa7887dd47a14f /drivers/kvm/mmu.c | |
parent | 63b1ad24d2695db3ec1cc8b10760e130e1a1f04b (diff) |
KVM: MMU: Fold fix_write_pf() into set_pte_common()
This prevents some work from being performed twice, and, more importantly,
reduces the number of places where we modify shadow ptes.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/mmu.c')
-rw-r--r-- | drivers/kvm/mmu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 2079d69f186a..3cdbf687df25 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -731,6 +731,17 @@ static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) | |||
731 | return r; | 731 | return r; |
732 | } | 732 | } |
733 | 733 | ||
734 | static void mmu_unshadow(struct kvm_vcpu *vcpu, gfn_t gfn) | ||
735 | { | ||
736 | struct kvm_mmu_page *page; | ||
737 | |||
738 | while ((page = kvm_mmu_lookup_page(vcpu, gfn)) != NULL) { | ||
739 | pgprintk("%s: zap %lx %x\n", | ||
740 | __FUNCTION__, gfn, page->role.word); | ||
741 | kvm_mmu_zap_page(vcpu, page); | ||
742 | } | ||
743 | } | ||
744 | |||
734 | static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa) | 745 | static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa) |
735 | { | 746 | { |
736 | int slot = memslot_id(kvm, gfn_to_memslot(kvm, gpa >> PAGE_SHIFT)); | 747 | int slot = memslot_id(kvm, gfn_to_memslot(kvm, gpa >> PAGE_SHIFT)); |