Received: from eggs.gnu.org ([2001:4830:134:3::10]:32809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bglTA-0007uw-3z for qemu-devel@nongnu.org; Mon, 05 Sep 2016 00:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bglT6-0004x8-0I for qemu-devel@nongnu.org; Mon, 05 Sep 2016 00:25:16 -0400 Date: Mon, 5 Sep 2016 13:42:08 +1000 From: David Gibson Message-ID: <20160905034208.GB3816@voom.fritz.box> References: <1472661255-20160-1-git-send-email-clg@kaod.org> <1472661255-20160-5-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FkmkrVfFsRoUs1wW" Content-Disposition: inline In-Reply-To: <1472661255-20160-5-git-send-email-clg@kaod.org> Subject: Re: [Qemu-devel] [PATCH v2 4/7] ppc/pnv: add a core mask to PnvChip List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 31, 2016 at 06:34:12PM +0200, C=E9dric Le Goater wrote: > This will be used to build real HW ids for the cores and enforce some > limits on the available cores per chip. >=20 > Signed-off-by: C=E9dric Le Goater > --- > hw/ppc/pnv.c | 27 +++++++++++++++++++++++++++ > include/hw/ppc/pnv.h | 2 ++ > 2 files changed, 29 insertions(+) >=20 > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > index a6e7f66b2c0a..b6efb5e3ef07 100644 > --- a/hw/ppc/pnv.c > +++ b/hw/ppc/pnv.c > @@ -236,6 +236,27 @@ static void ppc_powernv_init(MachineState *machine) > g_free(chip_typename); > } > =20 > +/* Allowed core identifiers on a POWER8 Processor Chip : > + * > + * > + * EX1 - Venice only > + * EX2 - Venice only > + * EX3 - Venice only > + * EX4 > + * EX5 > + * EX6 > + * > + * EX9 - Venice only > + * EX10 - Venice only > + * EX11 - Venice only > + * EX12 > + * EX13 > + * EX14 > + * > + */ > +#define POWER8E_CORE_MASK (~0xffff8f8f) > +#define POWER8_CORE_MASK (~0xffff8181) > + > static void pnv_chip_power8nvl_realize(PnvChip *chip, Error **errp) > { > ; > @@ -250,6 +271,8 @@ static void pnv_chip_power8nvl_class_init(ObjectClass= *klass, void *data) > k->cpu_model =3D "POWER8NVL"; > k->chip_type =3D PNV_CHIP_P8NVL; > k->chip_f000f =3D 0x120d304980000000ull; > + k->cores_max =3D 12; Is it worth having this cores_max field, since AFAICT you can calculate it as hweight(~cores_mask)? > + k->cores_mask =3D POWER8_CORE_MASK; > dc->desc =3D "PowerNV Chip POWER8NVL"; > } > =20 > @@ -274,6 +297,8 @@ static void pnv_chip_power8_class_init(ObjectClass *k= lass, void *data) > k->cpu_model =3D "POWER8"; > k->chip_type =3D PNV_CHIP_P8; > k->chip_f000f =3D 0x220ea04980000000ull; > + k->cores_max =3D 12; > + k->cores_mask =3D POWER8_CORE_MASK; > dc->desc =3D "PowerNV Chip POWER8"; > } > =20 > @@ -298,6 +323,8 @@ static void pnv_chip_power8e_class_init(ObjectClass *= klass, void *data) > k->cpu_model =3D "POWER8E"; > k->chip_type =3D PNV_CHIP_P8E; > k->chip_f000f =3D 0x221ef04980000000ull; > + k->cores_max =3D 6; > + k->cores_mask =3D POWER8E_CORE_MASK; > dc->desc =3D "PowerNV Chip POWER8E"; > } > =20 > diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h > index bc6e1f80096b..987bc70245a7 100644 > --- a/include/hw/ppc/pnv.h > +++ b/include/hw/ppc/pnv.h > @@ -49,6 +49,8 @@ typedef struct PnvChipClass { > /*< private >*/ > SysBusDeviceClass parent_class; > /*< public >*/ > + uint32_t cores_max; > + uint32_t cores_mask; > const char *cpu_model; > PnvChipType chip_type; > uint64_t chip_f000f; --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --FkmkrVfFsRoUs1wW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJXzOmQAAoJEGw4ysog2bOSILoP/09owutVZTS+IXjAz5tdNUDc qYWoASjJT6OgWbr5sB9ENRhZOLBXU7UZDl9PF4TsHSvWXfhdtG+B9AdFXGql/ZK5 QCotFh479Os/peixhFoBYDxwpRe9pdXbB00s9LeoIgLRIhppk22WZm/GR+2WaYXh 4M3pbbL36WaWUnxH/i2CqJ/zeAOMwlFQAWuCJnJLCArbCXUbah6QFmlA7Ay/GqCl lkhxyEQtHaDumK2v+SZA4LVI/Z35Wvc8WfgSR7BFjEowOYLZ+MWs6BLWjlU+J0sQ 0yAB8TWC2Q3H6wH/586nrsNgiHUTH3lsM01IlXK6u8dO0TXuzbq3IhEmW1ZIH3kP gmdaDyFmrCWFPLKRFq7J4jD+eZ89Fzb+WJMPN5WZzbCXJMP/3ryL3OlNFpTkuKez FGYJToqodHIOSe5hSp+wUMimrigxmIhQo+0dPcN7YfoFgIH/6FdNN7wE29sCI+CU N2OU56YAVrSHwo0FF+z94oCS/r08JG4uoiDf9PzcBXsaKN+BrDv4TNE+Ar/4EvFW HKRP9g8fW5Wg8wQuWx4dPNNR9KEb+6ffm8oN6shzd86bX4GsYMKmChzLhygCMl6m QDsRMG97bWvNSQYo0YIVOQAw4uGB8g5sZLXj1jbOpHEVPw0Ks6bOvWwHTq8XDmbv D0N5Ms0BQco4UhHvsTxS =IOgK -----END PGP SIGNATURE----- --FkmkrVfFsRoUs1wW--