svn commit: r185520 - user/dfr/xenhvm/6/sys/amd64/amd64

Doug Rabson dfr at FreeBSD.org
Mon Dec 1 08:32:46 PST 2008


Author: dfr
Date: Mon Dec  1 16:32:45 2008
New Revision: 185520
URL: http://svn.freebsd.org/changeset/base/185520

Log:
  Add a magic sequence which unplugs block and network devices from Xen's
  hardware emulator so that we can safely attach PV drivers to them without
  fighting with the ata and re drivers.

Modified:
  user/dfr/xenhvm/6/sys/amd64/amd64/machdep.c

Modified: user/dfr/xenhvm/6/sys/amd64/amd64/machdep.c
==============================================================================
--- user/dfr/xenhvm/6/sys/amd64/amd64/machdep.c	Mon Dec  1 15:27:00 2008	(r185519)
+++ user/dfr/xenhvm/6/sys/amd64/amd64/machdep.c	Mon Dec  1 16:32:45 2008	(r185520)
@@ -1352,6 +1352,14 @@ hammer_time(u_int64_t modulep, u_int64_t
 	if (env != NULL)
 		strlcpy(kernelname, env, sizeof(kernelname));
 
+#ifdef XENHVM
+	if (inw(0x10) == 0x49d2) {
+		if (bootverbose)
+			printf("Xen detected: disabling emulated block and network devices\n");
+		outw(0x10, 3);
+	}
+#endif
+
 	/* Location of kernel stack for locore */
 	return ((u_int64_t)thread0.td_pcb);
 }


More information about the svn-src-user mailing list