Date: Sat, 21 Dec 2013 15:58:41 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Roger Pau Monne <roger.pau@citrix.com>, royger@freebsd.org Cc: xen-devel@lists.xen.org, julien.grall@citrix.com, freebsd-xen@freebsd.org, freebsd-current@freebsd.org, kib@freebsd.org, gibbs@freebsd.org Subject: Re: [PATCH v7 10/19] xen: add hook for AP bootstrap memory reservation Message-ID: <20131221135841.GX59496@kib.kiev.ua> In-Reply-To: <1387479296-33389-11-git-send-email-roger.pau@citrix.com> References: <1387479296-33389-1-git-send-email-roger.pau@citrix.com> <1387479296-33389-11-git-send-email-roger.pau@citrix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131221135841.GX59496>