]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
WIP use new virt_to_xen_l1e
authorWei Liu <wei.liu2@citrix.com>
Tue, 22 Jan 2019 18:36:03 +0000 (18:36 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 22 Jan 2019 18:36:20 +0000 (18:36 +0000)
xen/arch/x86/domain_page.c

index 4a07cfb18e9478afa4defd89d2d0ee24b371e827..dbc0cff0f337571ea02e75de1ac005735e8b0390 100644 (file)
@@ -333,21 +333,23 @@ void unmap_domain_page_global(const void *ptr)
 mfn_t domain_page_map_to_mfn(const void *ptr)
 {
     unsigned long va = (unsigned long)ptr;
-    const l1_pgentry_t *pl1e;
+    l1_pgentry_t l1e;
 
     if ( va >= DIRECTMAP_VIRT_START )
         return _mfn(virt_to_mfn(ptr));
 
     if ( va >= VMAP_VIRT_START && va < VMAP_VIRT_END )
     {
-        pl1e = virt_to_xen_l1e(va);
+        const l1_pgentry_t *pl1e = virt_to_xen_l1e(va);
         BUG_ON(!pl1e);
+        l1e = *pl1e;
+        unmap_xen_pagetable(pl1e);
     }
     else
     {
         ASSERT(va >= MAPCACHE_VIRT_START && va < MAPCACHE_VIRT_END);
-        pl1e = &__linear_l1_table[l1_linear_offset(va)];
+        l1e = __linear_l1_table[l1_linear_offset(va)];
     }
 
-    return l1e_get_mfn(*pl1e);
+    return l1e_get_mfn(l1e);
 }