]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
x86_64/mm: map and unmap page tables in destroy_compat_m2p_mapping
authorWei Liu <wei.liu2@citrix.com>
Tue, 5 Feb 2019 13:09:18 +0000 (13:09 +0000)
committerHongyan Xia <hongyax@amazon.com>
Mon, 30 Sep 2019 08:40:45 +0000 (09:40 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/x86_64/mm.c

index e0d2190be1e10d050664bd9fee72e33fe2502e0f..2fff5f930672c2d6268b943b2cff7124a7a5c816 100644 (file)
@@ -252,11 +252,13 @@ static void destroy_compat_m2p_mapping(struct mem_hotadd_info *info)
     if ( emap > ((RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2) )
         emap = (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) >> 2;
 
-    l3_ro_mpt = l4e_to_l3e(idle_pg_table[l4_table_offset(HIRO_COMPAT_MPT_VIRT_START)]);
+    l3_ro_mpt = map_xen_pagetable_new(
+        l4e_get_mfn(idle_pg_table[l4_table_offset(HIRO_COMPAT_MPT_VIRT_START)]));
 
     ASSERT(l3e_get_flags(l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)]) & _PAGE_PRESENT);
 
-    l2_ro_mpt = l3e_to_l2e(l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)]);
+    l2_ro_mpt = map_xen_pagetable_new(
+        l3e_get_mfn(l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)]));
 
     for ( i = smap; i < emap; )
     {
@@ -278,6 +280,9 @@ static void destroy_compat_m2p_mapping(struct mem_hotadd_info *info)
         i += 1UL << (L2_PAGETABLE_SHIFT - 2);
     }
 
+    UNMAP_XEN_PAGETABLE_NEW(l2_ro_mpt);
+    UNMAP_XEN_PAGETABLE_NEW(l3_ro_mpt);
+
     return;
 }