]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: MMU: mmu_convert_notrap helper
authorMarcelo Tosatti <mtosatti@redhat.com>
Tue, 23 Sep 2008 16:18:38 +0000 (13:18 -0300)
committerAvi Kivity <avi@redhat.com>
Wed, 15 Oct 2008 12:25:24 +0000 (14:25 +0200)
Need to convert shadow_notrap_nonpresent -> shadow_trap_nonpresent when
unsyncing pages.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c

index c9b4b902527b6e93c05e739fd323866c76cf6231..57c7580e7f98abdb144451530e184993315f072c 100644 (file)
@@ -1173,6 +1173,20 @@ static void page_header_update_slot(struct kvm *kvm, void *pte, gfn_t gfn)
        __set_bit(slot, &sp->slot_bitmap);
 }
 
+static void mmu_convert_notrap(struct kvm_mmu_page *sp)
+{
+       int i;
+       u64 *pt = sp->spt;
+
+       if (shadow_trap_nonpresent_pte == shadow_notrap_nonpresent_pte)
+               return;
+
+       for (i = 0; i < PT64_ENT_PER_PAGE; ++i) {
+               if (pt[i] == shadow_notrap_nonpresent_pte)
+                       set_shadow_pte(&pt[i], shadow_trap_nonpresent_pte);
+       }
+}
+
 struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva)
 {
        struct page *page;