[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [RFC PATCH 65/84] x86: fix some wrong assumptions on direct map. Increase PMAP slots to 8.



From: Hongyan Xia <hongyax@xxxxxxxxxx>

Signed-off-by: Hongyan Xia <hongyax@xxxxxxxxxx>
---
 xen/arch/x86/domain_page.c | 8 --------
 xen/arch/x86/x86_64/mm.c   | 3 ++-
 xen/include/asm-x86/pmap.h | 4 ++--
 3 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/domain_page.c
index 4a3995ccef..f4f53a2a33 100644
--- a/xen/arch/x86/domain_page.c
+++ b/xen/arch/x86/domain_page.c
@@ -328,11 +328,6 @@ void *map_domain_page_global(mfn_t mfn)
              system_state < SYS_STATE_active) ||
             local_irq_is_enabled()));
 
-#ifdef NDEBUG
-    if ( mfn_x(mfn) <= PFN_DOWN(__pa(HYPERVISOR_VIRT_END - 1)) )
-        return mfn_to_virt(mfn_x(mfn));
-#endif
-
     return vmap(&mfn, 1);
 }
 
@@ -340,9 +335,6 @@ void unmap_domain_page_global(const void *ptr)
 {
     unsigned long va = (unsigned long)ptr;
 
-    if ( va >= DIRECTMAP_VIRT_START )
-        return;
-
     ASSERT(va >= VMAP_VIRT_START && va < VMAP_VIRT_END);
 
     vunmap(ptr);
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 37e8d59e5d..40f29f8ddc 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -712,7 +712,8 @@ void __init paging_init(void)
     if ( mfn_eq(l2_ro_mpt_mfn, INVALID_MFN) )
         goto nomem;
     l2_ro_mpt = map_xen_pagetable(l2_ro_mpt_mfn);
-    compat_idle_pg_table_l2 = l2_ro_mpt;
+    /* compat_idle_pg_table_l2 is used globally. */
+    compat_idle_pg_table_l2 = map_domain_page_global(l2_ro_mpt_mfn);
     clear_page(l2_ro_mpt);
     l3e_write(&l3_ro_mpt[l3_table_offset(HIRO_COMPAT_MPT_VIRT_START)],
               l3e_from_mfn(l2_ro_mpt_mfn, __PAGE_HYPERVISOR_RO));
diff --git a/xen/include/asm-x86/pmap.h b/xen/include/asm-x86/pmap.h
index feab1e9170..34d4f2bb38 100644
--- a/xen/include/asm-x86/pmap.h
+++ b/xen/include/asm-x86/pmap.h
@@ -1,8 +1,8 @@
 #ifndef __X86_PMAP_H__
 #define __X86_PMAP_H__
 
-/* Large enough for mapping 5 levels of page tables */
-#define NUM_FIX_PMAP 5
+/* Large enough for mapping 5 levels of page tables with some headroom */
+#define NUM_FIX_PMAP 8
 
 void pmap_lock(void);
 void pmap_unlock(void);
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.