From owner-svn-src-head@FreeBSD.ORG Tue Mar 11 10:26:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6CC7E2; Tue, 11 Mar 2014 10:26:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BADD26E; Tue, 11 Mar 2014 10:26:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2BAQGE0023250; Tue, 11 Mar 2014 10:26:16 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2BAQGDn023248; Tue, 11 Mar 2014 10:26:16 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201403111026.s2BAQGDn023248@svn.freebsd.org> From: Roger Pau Monné Date: Tue, 11 Mar 2014 10:26:16 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Mar 2014 10:26:17 -0000 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;