]> xenbits.xensource.com Git - xen.git/commitdiff
x86: drop (mostly) unused guest_lNe_get_paddr()
authorJan Beulich <jbeulich@suse.com>
Tue, 21 Jun 2016 10:05:09 +0000 (12:05 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 21 Jun 2016 10:05:09 +0000 (12:05 +0200)
The very few remaining uses don't make their presence really necessary:
Simplify the two L2 ones, and open code the sole common code use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/include/asm-x86/guest_pt.h

index 1f6c2ae357fa000cc1b1105573437f508c002114..a8d980cdf16423ec4948ae6cefb2dcba8741da14 100644 (file)
@@ -66,15 +66,10 @@ typedef struct { guest_intpte_t l2; } guest_l2e_t;
 
 #define PRI_gpte "08x"
 
-static inline paddr_t guest_l1e_get_paddr(guest_l1e_t gl1e)
-{ return ((paddr_t) gl1e.l1) & (PADDR_MASK & PAGE_MASK); }
-static inline paddr_t guest_l2e_get_paddr(guest_l2e_t gl2e)
-{ return ((paddr_t) gl2e.l2) & (PADDR_MASK & PAGE_MASK); }
-
 static inline gfn_t guest_l1e_get_gfn(guest_l1e_t gl1e)
-{ return _gfn(guest_l1e_get_paddr(gl1e) >> PAGE_SHIFT); }
+{ return _gfn(gl1e.l1 >> PAGE_SHIFT); }
 static inline gfn_t guest_l2e_get_gfn(guest_l2e_t gl2e)
-{ return _gfn(guest_l2e_get_paddr(gl2e) >> PAGE_SHIFT); }
+{ return _gfn(gl2e.l2 >> PAGE_SHIFT); }
 
 static inline u32 guest_l1e_get_flags(guest_l1e_t gl1e)
 { return gl1e.l1 & 0xfff; }
@@ -126,17 +121,6 @@ typedef intpte_t guest_intpte_t;
 
 #define PRI_gpte "016"PRIx64
 
-static inline paddr_t guest_l1e_get_paddr(guest_l1e_t gl1e)
-{ return l1e_get_paddr(gl1e); }
-static inline paddr_t guest_l2e_get_paddr(guest_l2e_t gl2e)
-{ return l2e_get_paddr(gl2e); }
-static inline paddr_t guest_l3e_get_paddr(guest_l3e_t gl3e)
-{ return l3e_get_paddr(gl3e); }
-#if GUEST_PAGING_LEVELS >= 4
-static inline paddr_t guest_l4e_get_paddr(guest_l4e_t gl4e)
-{ return l4e_get_paddr(gl4e); }
-#endif
-
 static inline gfn_t guest_l1e_get_gfn(guest_l1e_t gl1e)
 { return _gfn(l1e_get_paddr(gl1e) >> PAGE_SHIFT); }
 static inline gfn_t guest_l2e_get_gfn(guest_l2e_t gl2e)
@@ -278,7 +262,8 @@ guest_walk_to_gpa(walk_t *gw)
 {
     if ( !(guest_l1e_get_flags(gw->l1e) & _PAGE_PRESENT) )
         return 0;
-    return guest_l1e_get_paddr(gw->l1e) + (gw->va & ~PAGE_MASK);
+    return ((paddr_t)gfn_x(guest_l1e_get_gfn(gw->l1e)) << PAGE_SHIFT) +
+           (gw->va & ~PAGE_MASK);
 }
 
 /* Given a walk_t from a successful walk, return the page-order of the