Skip to contentSkip to conversation

Remove sh_{un}map_domain_page() and hap_{un}map_domain_page()

PATCH In review Ben Catterall 3 participants 4 messages Jul 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove sh_{un}map_domain_page() and hap_{un}map_domain_page()

Removed as they were wrappers around map_domain_page() to make it appear to take an mfn_t type.

---
 xen/arch/x86/mm/hap/hap.c        |   4 +-
 xen/arch/x86/mm/shadow/common.c  |  22 +++---
 xen/arch/x86/mm/shadow/multi.c   | 152 +++++++++++++++++++--------------------
 xen/arch/x86/mm/shadow/private.h |  13 ----
 xen/include/asm-x86/hap.h        |  15 ----
 5 files changed, 89 insertions(+), 117 deletions(-)
xen/arch/x86/mm/hap/hap.c +2 -2
index d0d3f1e..63980af 100644
@@ -395,7 +395,7 @@ static void hap_install_xen_entries_in_l4(struct vcpu *v, mfn_t l4mfn)
     struct domain *d = v->domain;
     l4_pgentry_t *l4e;
 
-    l4e = hap_map_domain_page(l4mfn);
+    l4e = map_domain_page(l4mfn);
 
     /* Copy the common Xen mappings from the idle domain */
     memcpy(&l4e[ROOT_PAGETABLE_FIRST_XEN_SLOT],
@@ -411,7 +411,7 @@ static void hap_install_xen_entries_in_l4(struct vcpu *v, mfn_t l4mfn)
     l4e[l4_table_offset(LINEAR_PT_VIRT_START)] =
         l4e_from_pfn(mfn_x(l4mfn), __PAGE_HYPERVISOR);
 
-    hap_unmap_domain_page(l4e);
+    unmap_domain_page(l4e);
 }
 
 static mfn_t hap_make_monitor_table(struct vcpu *v)
xen/arch/x86/mm/shadow/common.c +11 -11
index da6b847..3da9767 100644
@@ -781,11 +781,11 @@ static void oos_hash_add(struct vcpu *v, mfn_t gmfn)
     if ( swap )
         SWAP(oos_snapshot[idx], oos_snapshot[oidx]);
 
-    gptr = sh_map_domain_page(oos[oidx]);
-    gsnpptr = sh_map_domain_page(oos_snapshot[oidx]);
+    gptr = map_domain_page(oos[oidx]);
+    gsnpptr = map_domain_page(oos_snapshot[oidx]);
     memcpy(gsnpptr, gptr, PAGE_SIZE);
-    sh_unmap_domain_page(gptr);
-    sh_unmap_domain_page(gsnpptr);
+    unmap_domain_page(gptr);
+    unmap_domain_page(gsnpptr);
 }
 
 /* Remove an MFN from the list of out-of-sync guest pagetables */
@@ -1498,7 +1498,7 @@ mfn_t shadow_alloc(struct domain *d,
         p = __map_domain_page(sp);
         ASSERT(p != NULL);
         clear_page(p);
-        sh_unmap_domain_page(p);
+        unmap_domain_page(p);
         INIT_PAGE_LIST_ENTRY(&sp->list);
         page_list_add(sp, &tmp_list);
         sp->u.sh.type = shadow_type;
@@ -2524,7 +2524,7 @@ static int sh_remove_shadow_via_pointer(struct domain *d, mfn_t smfn)
     if (sp->up == 0) return 0;
     pmfn = _mfn(sp->up >> PAGE_SHIFT);
     ASSERT(mfn_valid(pmfn));
-    vaddr = sh_map_domain_page(pmfn);
+    vaddr = map_domain_page(pmfn);
     ASSERT(vaddr);
     vaddr += sp->up & (PAGE_SIZE-1);
     ASSERT(l1e_get_pfn(*(l1_pgentry_t *)vaddr) == mfn_x(smfn));
@@ -2554,7 +2554,7 @@ static int sh_remove_shadow_via_pointer(struct domain *d, mfn_t smfn)
     default: BUG(); /* Some wierd unknown shadow type */
     }
 
-    sh_unmap_domain_page(vaddr);
+    unmap_domain_page(vaddr);
     if ( rc )
         perfc_incr(shadow_up_pointer);
     else
@@ -3028,7 +3028,7 @@ int shadow_enable(struct domain *d, u32 mode)
             e[i] = ((0x400000U * i)
                     | _PAGE_PRESENT | _PAGE_RW | _PAGE_USER
                     | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_PSE);
-        sh_unmap_domain_page(e);
+        unmap_domain_page(e);
         pg->u.inuse.type_info = PGT_l2_page_table | 1 | PGT_validated;
     }
 
@@ -3631,8 +3631,8 @@ int shadow_track_dirty_vram(struct domain *d,
                         if ( sl1mfn != map_mfn )
                         {
                             if ( map_sl1p )
-                                sh_unmap_domain_page(map_sl1p);
-                            map_sl1p = sh_map_domain_page(_mfn(sl1mfn));
+                                unmap_domain_page(map_sl1p);
+                            map_sl1p = map_domain_page(_mfn(sl1mfn));
                             map_mfn = sl1mfn;
                         }
                         sl1e = map_sl1p + (sl1ma & ~PAGE_MASK);
@@ -3663,7 +3663,7 @@ int shadow_track_dirty_vram(struct domain *d,
         }
 
         if ( map_sl1p )
-            sh_unmap_domain_page(map_sl1p);
+            unmap_domain_page(map_sl1p);
 
         memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size);
         memset(dirty_vram->dirty_bitmap, 0, dirty_size);
xen/arch/x86/mm/shadow/multi.c +76 -76

508 lines not on this page · raw message

xen/arch/x86/mm/shadow/private.h +0 -13
index 31b36ef..48f1798 100644
@@ -504,19 +504,6 @@ sh_mfn_is_a_page_table(mfn_t gmfn)
     return type_info && (type_info <= PGT_l4_page_table);
 }
 
-// Provide mfn_t-aware versions of common xen functions
-static inline void *
-sh_map_domain_page(mfn_t mfn)
-{
-    return map_domain_page(mfn);
-}
-
-static inline void
-sh_unmap_domain_page(void *p)
-{
-    unmap_domain_page(p);
-}
-
 /**************************************************************************/
 /* Shadow-page refcounting. */
 
xen/include/asm-x86/hap.h +0 -15
index ca590f3..c13e536 100644
@@ -32,21 +32,6 @@
     printk("hap error: %s(): " _f, __func__, ##_a)
 
 /************************************************/
-/*          hap domain page mapping             */
-/************************************************/
-static inline void *
-hap_map_domain_page(mfn_t mfn)
-{
-    return map_domain_page(mfn);
-}
-
-static inline void
-hap_unmap_domain_page(void *p)
-{
-    unmap_domain_page(p);
-}
-
-/************************************************/
 /*        hap domain level functions            */
 /************************************************/
 void  hap_domain_init(struct domain *d);
Signature · 1 line
2.1.4
#2 lore raw
Quoted 11 lines · Andrew Cooper
Quoted 4 lines · Ben Catterall

Removed as they were wrappers around map_domain_page() to make it appear to take an mfn_t type.

In the future, a patch like this should either state it is dependent on another series, or in this case, probably be a 4/4 on the existing series.

~Andrew

Ah ok, understood!

Ben