]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
xxx paging_init
authorWei Liu <wei.liu2@citrix.com>
Thu, 31 Jan 2019 18:26:56 +0000 (18:26 +0000)
committerWei Liu <wei.liu2@citrix.com>
Mon, 4 Feb 2019 15:46:47 +0000 (15:46 +0000)
xen/arch/x86/x86_64/mm.c

index 15940c23c9b0aaa34d157f2e8173248b314b1904..629b667b1d2ea36b3adfbe13fe7a77271f5c944b 100644 (file)
@@ -650,12 +650,15 @@ void __init paging_init(void)
                  l4_table_offset(HIRO_COMPAT_MPT_VIRT_START));
     l3_ro_mpt = l4e_to_l3e(idle_pg_table[l4_table_offset(
         HIRO_COMPAT_MPT_VIRT_START)]);
-    if ( (l2_ro_mpt = alloc_xen_pagetable()) == NULL )
+
+    l2_ro_mpt_mfn = alloc_xen_pagetable_new();
+    if ( mfn_eq(l2_ro_mpt_mfn, INVALID_MFN) )
         goto nomem;
+    l2_ro_mpt = map_xen_pagetable_new(l2_ro_mpt_mfn);
     compat_idle_pg_table_l2 = l2_ro_mpt;
     clear_page(l2_ro_mpt);
     l3e_write(&l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
-              l3e_from_paddr(__pa(l2_ro_mpt), __PAGE_HYPERVISOR_RO));
+              l3e_from_mfn(l2_ro_mpt_mfn, __PAGE_HYPERVISOR_RO));
     pl2e = l2_ro_mpt;
     pl2e += l2_table_offset(HIRO_COMPAT_MPT_VIRT_START);
     /* Allocate and map the compatibility mode machine-to-phys table. */
@@ -697,6 +700,8 @@ void __init paging_init(void)
 #undef CNT
 #undef MFN
 
+    unmap_xen_pagetable_new(l2_ro_mpt);
+
     machine_to_phys_mapping_valid = 1;
 
     /* Set up linear page table mapping. */