Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5a4c8cad952d6e060991841f3632578ab3ae133
Commit:     e5a4c8cad952d6e060991841f3632578ab3ae133
Parent:     26e5215fdc6cf7b5a8b1269134095abbb7338b3c
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 20 21:39:54 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 17:53:09 2008 +0200

    KVM: MMU: Implement guest page fault bypass for nonpae
    
    I spent an hour worrying why I see so many guest page faults on FC6 i386.
    Turns out bypass wasn't implemented for nonpae.  Implement it so it doesn't
    happen again.
    
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/paging_tmpl.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index bf15d12..92b9313 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -486,19 +486,22 @@ static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, 
gva_t vaddr)
 static void FNAME(prefetch_page)(struct kvm_vcpu *vcpu,
                                 struct kvm_mmu_page *sp)
 {
-       int i;
+       int i, offset = 0;
        pt_element_t *gpt;
        struct page *page;
 
-       if (sp->role.metaphysical || PTTYPE == 32) {
+       if (sp->role.metaphysical
+           || (PTTYPE == 32 && sp->role.level > PT_PAGE_TABLE_LEVEL)) {
                nonpaging_prefetch_page(vcpu, sp);
                return;
        }
 
+       if (PTTYPE == 32)
+               offset = sp->role.quadrant << PT64_LEVEL_BITS;
        page = gfn_to_page(vcpu->kvm, sp->gfn);
        gpt = kmap_atomic(page, KM_USER0);
        for (i = 0; i < PT64_ENT_PER_PAGE; ++i)
-               if (is_present_pte(gpt[i]))
+               if (is_present_pte(gpt[offset + i]))
                        sp->spt[i] = shadow_trap_nonpresent_pte;
                else
                        sp->spt[i] = shadow_notrap_nonpresent_pte;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to