Subject: Re: NetBSD/xen with 4 GB RAM
To: None <martti.kuparinen@iki.fi>
From: None <marcotte@panix.com>
List: port-xen
Date: 01/24/2008 22:07:09
> How is NetBSD dom0 supposed to work on hosts with 4 GB or more memory?
> 
> I installed NetBSD/i386 4.0_STABLE on Dell PowerEdge 850 (it was previously
> running NetBSD/i386 3.1.1 as dom0) and configured it as dom0. I'm having
> problems with this dom0, domUs simply will not start as they die during the
> early stages of startup.

I've been using the following hack on my SuperMicro PDSMI+ systems. It
appears to work on NetBSD 3 and 4.

I have not tried to get this committed as it would probably take me
another week to fully understand Xen and i386 VM before I could really
say this was "correct". It could also be a bit cleaner.

I have no idea if this is needed or works in -current.


--- sys/arch/xen/i386/xen_machdep.c.orig	2006-01-22 15:15:51.000000000 -0500
+++ sys/arch/xen/i386/xen_machdep.c	2007-09-04 20:08:41.000000000 -0400
@@ -307,8 +307,12 @@
 static pt_entry_t
 xpmap_get_bootpte(paddr_t va)
 {
+	pt_entry_t *pte;
 
-	return xpmap_get_bootptep(va)[0];
+	pte=xpmap_get_bootptep(va);
+	if (pte==(void *)-1)
+		return 0;
+	return pte[0];
 }
 
 #if defined(XENDEBUG)
@@ -418,6 +422,9 @@
 				continue;
 			if (ptp[j] >= KERNTEXTOFF) {
 				pte = ptp[j];
+				if (xpmap_get_bootpte(pte & PG_FRAME)==0) {
+					continue;
+				}
 				ptp[j] = (pte & ~PG_FRAME) |
 					(xpmap_get_bootpte(pte & PG_FRAME) &
 					    PG_FRAME);