Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2014 10:26:16 +0000 (UTC)
From:      Roger Pau Monné <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263012 - in head/sys: amd64/amd64 x86/include
Message-ID:  <201403111026.s2BAQGDn023248@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Tue Mar 11 10:26:16 2014
New Revision: 263012
URL: http://svnweb.freebsd.org/changeset/base/263012

Log:
  xen: add hook for AP bootstrap memory reservation
  
  This hook will only be implemented for bare metal, Xen doesn't require
  any bootstrap code since APs are started in long mode with paging
  enabled.
  
  Approved by: gibbs
  Sponsored by: Citrix Systems R&D
  
  amd64/amd64/machdep.c:
   - Set mp_bootaddress hook for bare metal.
  
  x86/include/init.h:
   - Define mp_bootaddress in init_ops.

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/x86/include/init.h

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Tue Mar 11 10:25:08 2014	(r263011)
+++ head/sys/amd64/amd64/machdep.c	Tue Mar 11 10:26:16 2014	(r263012)
@@ -178,6 +178,9 @@ struct init_ops init_ops = {
 	.early_clock_source_init =	i8254_init,
 	.early_delay =			i8254_delay,
 	.parse_memmap =			native_parse_memmap,
+#ifdef SMP
+	.mp_bootaddress =		mp_bootaddress,
+#endif
 };
 
 /*
@@ -1490,10 +1493,14 @@ getmemsize(caddr_t kmdp, u_int64_t first
 	if (basemem == 0)
 		panic("BIOS smap did not include a basemem segment!");
 
-#ifdef SMP
-	/* make hole for AP bootstrap code */
-	physmap[1] = mp_bootaddress(physmap[1] / 1024);
-#endif
+	/*
+	 * Make hole for "AP -> long mode" bootstrap code.  The
+	 * mp_bootaddress vector is only available when the kernel
+	 * is configured to support APs and APs for the system start
+	 * in 32bit mode (e.g. SMP bare metal).
+	 */
+	if (init_ops.mp_bootaddress)
+		physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024);
 
 	/*
 	 * Maxmem isn't the "maximum memory", it's one larger than the

Modified: head/sys/x86/include/init.h
==============================================================================
--- head/sys/x86/include/init.h	Tue Mar 11 10:25:08 2014	(r263011)
+++ head/sys/x86/include/init.h	Tue Mar 11 10:26:16 2014	(r263012)
@@ -39,6 +39,7 @@ struct init_ops {
 	void	(*early_clock_source_init)(void);
 	void	(*early_delay)(int);
 	void	(*parse_memmap)(caddr_t, vm_paddr_t *, int *);
+	u_int	(*mp_bootaddress)(u_int);
 };
 
 extern struct init_ops init_ops;



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