Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d28f5f4a4984be4cd7200ed512c94517c13e392
Commit:     1d28f5f4a4984be4cd7200ed512c94517c13e392
Parent:     0d81f2966a61953c4cc7397342f5f907b3a6e257
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 21 15:01:44 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 17:53:12 2008 +0200

    KVM: Remove gpa_to_hpa()
    
    Converting last uses along the way.
    
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm.h |    1 -
 drivers/kvm/mmu.c |   21 +++------------------
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 31315bc..1fd8158 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -375,7 +375,6 @@ int kvm_init(void *opaque, unsigned int vcpu_size,
                  struct module *module);
 void kvm_exit(void);
 
-hpa_t gpa_to_hpa(struct kvm *kvm, gpa_t gpa);
 #define HPA_MSB ((sizeof(hpa_t) * 8) - 1)
 #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB)
 static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 6aa0319..9b75b10 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -868,26 +868,13 @@ static void page_header_update_slot(struct kvm *kvm, void 
*pte, gfn_t gfn)
        __set_bit(slot, &page_head->slot_bitmap);
 }
 
-hpa_t gpa_to_hpa(struct kvm *kvm, gpa_t gpa)
-{
-       struct page *page;
-       hpa_t hpa;
-
-       ASSERT((gpa & HPA_ERR_MASK) == 0);
-       page = gfn_to_page(kvm, gpa >> PAGE_SHIFT);
-       hpa = ((hpa_t)page_to_pfn(page) << PAGE_SHIFT) | (gpa & (PAGE_SIZE-1));
-       if (is_error_page(page))
-               return hpa | HPA_ERR_MASK;
-       return hpa;
-}
-
 struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva)
 {
        gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, gva);
 
        if (gpa == UNMAPPED_GVA)
                return NULL;
-       return pfn_to_page(gpa_to_hpa(vcpu->kvm, gpa) >> PAGE_SHIFT);
+       return gfn_to_page(vcpu->kvm, gpa >> PAGE_SHIFT);
 }
 
 static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
@@ -1611,8 +1598,8 @@ static void audit_mappings_page(struct kvm_vcpu *vcpu, 
u64 page_pte,
                        audit_mappings_page(vcpu, ent, va, level - 1);
                } else {
                        gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, va);
-                       hpa_t hpa = gpa_to_hpa(vcpu, gpa);
-                       struct page *page;
+                       struct page *page = gpa_to_page(vcpu, gpa);
+                       hpa_t hpa = page_to_phys(page);
 
                        if (is_shadow_present_pte(ent)
                            && (ent & PT64_BASE_ADDR_MASK) != hpa)
@@ -1625,8 +1612,6 @@ static void audit_mappings_page(struct kvm_vcpu *vcpu, 
u64 page_pte,
                                 && !is_error_hpa(hpa))
                                printk(KERN_ERR "audit: (%s) notrap shadow,"
                                       " valid guest gva %lx\n", audit_msg, va);
-                       page = pfn_to_page((gpa & PT64_BASE_ADDR_MASK)
-                                          >> PAGE_SHIFT);
                        kvm_release_page_clean(page);
 
                }
-
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