Received: from eggs.gnu.org ([2001:4830:134:3::10]:52758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf8UO-0007Gj-1p for qemu-devel@nongnu.org; Wed, 31 Aug 2016 12:35:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf8UM-0002pf-Uv for qemu-devel@nongnu.org; Wed, 31 Aug 2016 12:35:48 -0400 Received: from 1.mo53.mail-out.ovh.net ([178.32.108.164]:34413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf8UM-0002pW-Os for qemu-devel@nongnu.org; Wed, 31 Aug 2016 12:35:46 -0400 Received: from player159.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo53.mail-out.ovh.net (Postfix) with ESMTP id 41DAC43D32 for ; Wed, 31 Aug 2016 18:35:46 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 31 Aug 2016 18:34:12 +0200 Message-Id: <1472661255-20160-5-git-send-email-clg@kaod.org> In-Reply-To: <1472661255-20160-1-git-send-email-clg@kaod.org> References: <1472661255-20160-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [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: qemu-ppc@nongnu.org Cc: David Gibson , Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , Cedric Le Goater This will be used to build real HW ids for the cores and enforce some limits on the available cores per chip. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 27 +++++++++++++++++++++++++++ include/hw/ppc/pnv.h | 2 ++ 2 files changed, 29 insertions(+) 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; + 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 2.7.4