Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Feb 2012 12:44:35 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232295 - in head/sys/arm: mv xscale/i8134x
Message-ID:  <201202291244.q1TCiZZi027249@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cognet
Date: Wed Feb 29 12:44:34 2012
New Revision: 232295
URL: http://svn.freebsd.org/changeset/base/232295

Log:
  Make sure we do not provide the page 0 to the VM. It can't handle it properly,
  because pmap_extract() returns 0 when there's no mapping.
  
  PR:		arm/154227
  MFC after:	1 week

Modified:
  head/sys/arm/mv/mv_machdep.c
  head/sys/arm/xscale/i8134x/crb_machdep.c

Modified: head/sys/arm/mv/mv_machdep.c
==============================================================================
--- head/sys/arm/mv/mv_machdep.c	Wed Feb 29 12:13:05 2012	(r232294)
+++ head/sys/arm/mv/mv_machdep.c	Wed Feb 29 12:44:34 2012	(r232295)
@@ -287,9 +287,19 @@ physmap_init(void)
 		    availmem_regions[i].mr_start + availmem_regions[i].mr_size,
 		    availmem_regions[i].mr_size);
 
-		phys_avail[j] = availmem_regions[i].mr_start;
-		phys_avail[j + 1] = availmem_regions[i].mr_start +
-		    availmem_regions[i].mr_size;
+		/* 
+		 * We should not map the page at PA 0x0000000, the VM can't
+		 * handle it, as pmap_extract() == 0 means failure.
+		 */
+		if (availmem_regions[i].mr_start > 0 ||
+		    availmem_regions[i].mr_size > PAGE_SIZE) {
+			phys_avail[j] = availmem_regions[i].mr_start;
+			if (phys_avail[j] == 0)
+				phys_avail[j] += PAGE_SIZE;
+			phys_avail[j + 1] = availmem_regions[i].mr_start +
+			    availmem_regions[i].mr_size;
+		} else
+			j -= 2;
 	}
 	phys_avail[j] = 0;
 	phys_avail[j + 1] = 0;

Modified: head/sys/arm/xscale/i8134x/crb_machdep.c
==============================================================================
--- head/sys/arm/xscale/i8134x/crb_machdep.c	Wed Feb 29 12:13:05 2012	(r232294)
+++ head/sys/arm/xscale/i8134x/crb_machdep.c	Wed Feb 29 12:44:34 2012	(r232295)
@@ -381,8 +381,8 @@ initarm(void *arg, void *arg2)
 	
 	i = 0;
 #ifdef ARM_USE_SMALL_ALLOC
-	phys_avail[i++] = 0x00000000;
-	phys_avail[i++] = 0x00001000; 	/*
+	phys_avail[i++] = 0x00001000;
+	phys_avail[i++] = 0x00002000; 	/*
 					 *XXX: Gross hack to get our
 					 * pages in the vm_page_array
 					 . */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202291244.q1TCiZZi027249>