]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: Disable the mfn_is_ram() check, it doesn't work correctly on all systems
authorMatthew Fioravante <matthew.fioravante@jhuapl.edu>
Mon, 8 Oct 2012 13:36:30 +0000 (14:36 +0100)
committerMatthew Fioravante <matthew.fioravante@jhuapl.edu>
Mon, 8 Oct 2012 13:36:30 +0000 (14:36 +0100)
This patch disables the mfn_is_ram check in mini-os. The current check
is insufficient and fails on some systems with larger than 4gb memory.

Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyons.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
arch/x86/ioremap.c
arch/x86/mm.c
include/x86/arch_mm.h

index c7f818609c25680c172697f3a3a5b0db06a8b7c9..4384b1c0a4c418d0aa516549931853ff4942e766 100644 (file)
@@ -35,7 +35,6 @@ static void *__do_ioremap(unsigned long phys_addr, unsigned long size,
     unsigned long va;
     unsigned long mfns, mfn;
     unsigned long num_pages, offset;
-    int i;
 
     /* allow non page aligned addresses but for mapping we need to align them */
     offset = (phys_addr & ~PAGE_MASK);
@@ -43,21 +42,9 @@ static void *__do_ioremap(unsigned long phys_addr, unsigned long size,
     phys_addr &= PAGE_MASK;
     mfns = mfn = phys_addr >> PAGE_SHIFT;
     
-    /* sanity checks on list of MFNs */
-    for ( i = 0; i < num_pages; i++, mfn++ )
-    {
-        if ( mfn_is_ram(mfn) )
-        {
-            printk("ioremap: mfn 0x%ulx is RAM\n", mfn);
-            goto mfn_invalid;
-        }
-    }   
     va = (unsigned long)map_frames_ex(&mfns, num_pages, 0, 1, 1,
                                       DOMID_IO, NULL, prot);
     return (void *)(va + offset);
-    
-mfn_invalid:
-    return NULL;
 }
 
 void *ioremap(unsigned long phys_addr, unsigned long size)
index 80aceacd2a28d07e4930fdc0bb9a40ab9ac8c388..35df15bd1e9ff99086d9ec57d1aac5acd797ec5d 100644 (file)
@@ -844,18 +844,6 @@ unsigned long alloc_contig_pages(int order, unsigned int addr_bits)
     return in_va;
 }
 
-/*
- * Check if a given MFN refers to real memory
- */
-static long system_ram_end_mfn;
-int mfn_is_ram(unsigned long mfn)
-{
-    /* very crude check if a given MFN is memory or not. Probably should
-     * make this a little more sophisticated ;) */
-    return (mfn <= system_ram_end_mfn) ? 1 : 0;
-}
-
-
 /*
  * Clear some of the bootstrap memory
  */
@@ -951,10 +939,6 @@ void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
     clear_bootstrap();
     set_readonly(&_text, &_erodata);
 
-    /* get the number of physical pages the system has. Used to check for
-     * system memory. */
-    system_ram_end_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
-
     *start_pfn_p = start_pfn;
     *max_pfn_p = max_pfn;
 }
index a95632ad4967f725cb02a1ff36b5455084dc443c..23cfca7bfe190296030a3276c32064b5453b7762 100644 (file)
@@ -229,6 +229,5 @@ static __inline__ paddr_t machine_to_phys(maddr_t machine)
 #define do_map_zero(start, n) do_map_frames(start, &mfn_zero, n, 0, 0, DOMID_SELF, NULL, L1_PROT_RO)
 
 pgentry_t *need_pgt(unsigned long addr);
-int mfn_is_ram(unsigned long mfn);
 
 #endif /* _ARCH_MM_H_ */