From owner-freebsd-current@FreeBSD.ORG Sat Dec 21 14:00:05 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 583FC7FB; Sat, 21 Dec 2013 14:00:05 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C18AE171A; Sat, 21 Dec 2013 14:00:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBLDwfo9027305; Sat, 21 Dec 2013 15:58:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBLDwfo9027305 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBLDwfcL027304; Sat, 21 Dec 2013 15:58:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Dec 2013 15:58:41 +0200 From: Konstantin Belousov To: Roger Pau Monne , royger@freebsd.org Subject: Re: [PATCH v7 10/19] xen: add hook for AP bootstrap memory reservation Message-ID: <20131221135841.GX59496@kib.kiev.ua> References: <1387479296-33389-1-git-send-email-roger.pau@citrix.com> <1387479296-33389-11-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n3hFPmSitNO6nIHR" Content-Disposition: inline In-Reply-To: <1387479296-33389-11-git-send-email-roger.pau@citrix.com> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: xen-devel@lists.xen.org, julien.grall@citrix.com, freebsd-xen@freebsd.org, freebsd-current@freebsd.org, kib@freebsd.org, gibbs@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Dec 2013 14:00:05 -0000 --n3hFPmSitNO6nIHR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 19, 2013 at 07:54:47PM +0100, Roger Pau Monne wrote: > 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. > --- > sys/amd64/amd64/machdep.c | 6 +++++- > sys/amd64/include/sysarch.h | 3 +++ > 2 files changed, 8 insertions(+), 1 deletions(-) >=20 > diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c > index 6bbfe5a..a811a9b 100644 > --- a/sys/amd64/amd64/machdep.c > +++ b/sys/amd64/amd64/machdep.c > @@ -186,6 +186,9 @@ struct init_ops init_ops =3D { > .early_delay_init =3D i8254_init, > .early_delay =3D i8254_delay, > .parse_memmap =3D native_parse_memmap, > +#ifdef SMP > + .mp_bootaddress =3D mp_bootaddress, > +#endif > }; > =20 > /* > @@ -1507,7 +1510,8 @@ getmemsize(caddr_t kmdp, u_int64_t first) > =20 > #ifdef SMP > /* make hole for AP bootstrap code */ > - physmap[1] =3D mp_bootaddress(physmap[1] / 1024); > + if (init_ops.mp_bootaddress) > + physmap[1] =3D init_ops.mp_bootaddress(physmap[1] / 1024); > #endif > =20 > /* > diff --git a/sys/amd64/include/sysarch.h b/sys/amd64/include/sysarch.h > index 084223e..77f4b29 100644 > --- a/sys/amd64/include/sysarch.h > +++ b/sys/amd64/include/sysarch.h > @@ -16,6 +16,9 @@ struct init_ops { > void (*early_delay_init)(void); > void (*early_delay)(int); > void (*parse_memmap)(caddr_t, vm_paddr_t *, int *); > +#ifdef SMP > + u_int (*mp_bootaddress)(u_int); > +#endif > }; > =20 > extern struct init_ops init_ops; I suggest to make the init_ops contain the mp_bootaddress unconditionally, instead of making it depended on SMP. The #ifdef makes the kernel binary interface fragile and depended on the config, which would cause problems in future if any module needs any interation with init_ops. --n3hFPmSitNO6nIHR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJStZ6QAAoJEJDCuSvBvK1B1lIQAJZBaZKW30oWuiwH0kswmBgE uBi/aWXUO9ENY9Cw1xjmqWLL2s1Xw3joA4kTJth6I45SfYcifUihKZlpYdr+WEf/ Gut/qF7zZyPLQrfEtrpAr1HgFopgQyBw+7zQvMCHaJAKeAP0AKXE6tsdzeNvSan2 zQ7WrgmH054Fraqnq4w6ebJD0uIeOZdmGA4Cifv8XVSXZVhr9XpuPrlIEe66x5Al 2YBlqaHFpZwTbh3SCCfaFpgv0p55VxW3VtX+u+2gb9m2DFbPF67U9CLXKKyupkjc zbTE8kDU+X+eS005wcC0LcVMBFLXJ+kAdP9pMMsMukkmUFCDpWvjvYn3g+9TXN9E lQbE72H7FJs7InHtgXeKADOMyqMsJUg+lQ5hGyR9MShaahrr6E/LMiwncYQLluZl S/6JoL3uqI5BjuZYUWhzIFbckccvRnqPowLmJbIjY1/7qsFTdM/tny9CjuXGGcIW bEhQ46Pi7GIZG/ATGDd5b/BLJvXDdrNsXA06Ro7bdoc1YInu/hrpz9DN+Oyg37ld edANo0xiwEGpPYl2rl87y4ftNfev2X9srEd9MSSCpqWmeMeFJoVQwyk8/R4a9rvL AVGnC0WX6oXcYFpOsNqYeyHntgTmgB7XxwdMCW8odJdr81fOE+WsdAACKn+8K4LD gGEmtbZlRqTIiPqOGgBi =qPyT -----END PGP SIGNATURE----- --n3hFPmSitNO6nIHR--