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

[Xen-changelog] [xen-unstable] minios: Disable the mfn_is_ram() check, it doesn't work correctly on all systems


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 10 Oct 2012 22:11:13 +0000
  • Delivery-date: Wed, 10 Oct 2012 22:11:24 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Matthew Fioravante <matthew.fioravante@xxxxxxxxxx>
# Date 1349703390 -3600
# Node ID 42ca0ed31aa68293ba9b13e6a3ce9b4c3da97deb
# Parent  8fdb8d464eceaa3ae40000523b873c183c5a09d9
minios: Disable the mfn_is_ram() check, it doesn't work correctly on all systems

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@xxxxxxxxxx>
Acked-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/arch/x86/ioremap.c
--- a/extras/mini-os/arch/x86/ioremap.c Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/arch/x86/ioremap.c Mon Oct 08 14:36:30 2012 +0100
@@ -35,7 +35,6 @@ static void *__do_ioremap(unsigned long 
     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 &= 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)
diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/arch/x86/mm.c
--- a/extras/mini-os/arch/x86/mm.c      Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/arch/x86/mm.c      Mon Oct 08 14:36:30 2012 +0100
@@ -845,18 +845,6 @@ unsigned long alloc_contig_pages(int ord
 }
 
 /*
- * 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
  */
 static void clear_bootstrap(void)
@@ -951,10 +939,6 @@ void arch_init_mm(unsigned long* start_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;
 }
diff -r 8fdb8d464ece -r 42ca0ed31aa6 extras/mini-os/include/x86/arch_mm.h
--- a/extras/mini-os/include/x86/arch_mm.h      Mon Oct 08 14:36:29 2012 +0100
+++ b/extras/mini-os/include/x86/arch_mm.h      Mon Oct 08 14:36:30 2012 +0100
@@ -229,6 +229,5 @@ static __inline__ paddr_t machine_to_phy
 #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_ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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