Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6bcbd6aba00fced696fc99f1a4fcd7ac7d42d6ef
Commit:     6bcbd6aba00fced696fc99f1a4fcd7ac7d42d6ef
Parent:     cd4a4e5374110444dc38831af517e51ff5a053c3
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 5 16:36:39 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Jan 5 23:55:24 2007 -0800

    [PATCH] KVM: MMU: Teach the page table walker to track guest page table gfns
    
    Saving the table gfns removes the need to walk the guest and host page 
tables
    in lockstep.
    
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/kvm/paging_tmpl.h |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/paging_tmpl.h b/drivers/kvm/paging_tmpl.h
index 8c48528..3a35c80 100644
--- a/drivers/kvm/paging_tmpl.h
+++ b/drivers/kvm/paging_tmpl.h
@@ -52,6 +52,7 @@
  */
 struct guest_walker {
        int level;
+       gfn_t table_gfn;
        pt_element_t *table;
        pt_element_t inherited_ar;
 };
@@ -63,8 +64,8 @@ static void FNAME(init_walker)(struct guest_walker *walker,
        struct kvm_memory_slot *slot;
 
        walker->level = vcpu->mmu.root_level;
-       slot = gfn_to_memslot(vcpu->kvm,
-                             (vcpu->cr3 & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT);
+       walker->table_gfn = (vcpu->cr3 & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT;
+       slot = gfn_to_memslot(vcpu->kvm, walker->table_gfn);
        hpa = safe_gpa_to_hpa(vcpu, vcpu->cr3 & PT64_BASE_ADDR_MASK);
        walker->table = kmap_atomic(pfn_to_page(hpa >> PAGE_SHIFT), KM_USER0);
 
@@ -133,6 +134,8 @@ static pt_element_t *FNAME(fetch_guest)(struct kvm_vcpu 
*vcpu,
                        return &walker->table[index];
                if (walker->level != 3 || is_long_mode(vcpu))
                        walker->inherited_ar &= walker->table[index];
+               walker->table_gfn = (walker->table[index] & PT_BASE_ADDR_MASK)
+                       >> PAGE_SHIFT;
                paddr = safe_gpa_to_hpa(vcpu, walker->table[index] & 
PT_BASE_ADDR_MASK);
                kunmap_atomic(walker->table, KM_USER0);
                walker->table = kmap_atomic(pfn_to_page(paddr >> PAGE_SHIFT),
-
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