From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmWUg-0003bX-TN for qemu-devel@nongnu.org; Tue, 20 Sep 2016 21:38:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmWUc-00033Q-RM for qemu-devel@nongnu.org; Tue, 20 Sep 2016 21:38:38 -0400 Date: Wed, 21 Sep 2016 11:29:03 +1000 From: David Gibson Message-ID: <20160921012903.GO20488@umbus> References: <1473943560-14846-1-git-send-email-clg@kaod.org> <1473943560-14846-5-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ceI9FlwgjS98XxYT" Content-Disposition: inline In-Reply-To: <1473943560-14846-5-git-send-email-clg@kaod.org> Subject: Re: [Qemu-devel] [PATCH v3 04/10] ppc/pnv: add a PIR handler 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 --ceI9FlwgjS98XxYT Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 15, 2016 at 02:45:54PM +0200, C=E9dric Le Goater wrote: > P9 and P8 have some differences in the CPU PIR encoding. The thread id isn't in the PIR at all? >=20 > Signed-off-by: C=E9dric Le Goater > --- > hw/ppc/pnv.c | 14 ++++++++++++++ > include/hw/ppc/pnv.h | 1 + > 2 files changed, 15 insertions(+) >=20 > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > index ec7dd6ac5ea1..f4c125503249 100644 > --- a/hw/ppc/pnv.c > +++ b/hw/ppc/pnv.c > @@ -238,6 +238,16 @@ static void ppc_powernv_init(MachineState *machine) > g_free(chip_typename); > } > =20 > +static uint32_t pnv_chip_core_pir_p8(PnvChip *chip, uint32_t core_id) > +{ > + return (chip->chip_id << 7) | (core_id << 3); > +} > + > +static uint32_t pnv_chip_core_pir_p9(PnvChip *chip, uint32_t core_id) > +{ > + return (chip->chip_id << 8) | (core_id << 2); > +} > + > /* Allowed core identifiers on a POWER8 Processor Chip : > * > * > @@ -273,6 +283,7 @@ static void pnv_chip_power8e_class_init(ObjectClass *= klass, void *data) > k->chip_type =3D PNV_CHIP_POWER8E; > k->chip_cfam_id =3D 0x221ef04980000000ull; /* P8 Murano DD2.1 */ > k->cores_mask =3D POWER8E_CORE_MASK; > + k->core_pir =3D pnv_chip_core_pir_p8; > dc->desc =3D "PowerNV Chip POWER8E"; > } > =20 > @@ -292,6 +303,7 @@ static void pnv_chip_power8_class_init(ObjectClass *k= lass, void *data) > k->chip_type =3D PNV_CHIP_POWER8; > k->chip_cfam_id =3D 0x220ea04980000000ull; /* P8 Venice DD2.0 */ > k->cores_mask =3D POWER8_CORE_MASK; > + k->core_pir =3D pnv_chip_core_pir_p8; > dc->desc =3D "PowerNV Chip POWER8"; > } > =20 > @@ -311,6 +323,7 @@ static void pnv_chip_power8nvl_class_init(ObjectClass= *klass, void *data) > k->chip_type =3D PNV_CHIP_POWER8NVL; > k->chip_cfam_id =3D 0x120d304980000000ull; /* P8 Naples DD1.0 */ > k->cores_mask =3D POWER8_CORE_MASK; > + k->core_pir =3D pnv_chip_core_pir_p8; > dc->desc =3D "PowerNV Chip POWER8NVL"; > } > =20 > @@ -330,6 +343,7 @@ static void pnv_chip_power9_class_init(ObjectClass *k= lass, void *data) > k->chip_type =3D PNV_CHIP_POWER9; > k->chip_cfam_id =3D 0x100d104980000000ull; /* P9 Nimbus DD1.0 */ > k->cores_mask =3D POWER9_CORE_MASK; > + k->core_pir =3D pnv_chip_core_pir_p9; > dc->desc =3D "PowerNV Chip POWER9"; > } > =20 > diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h > index cfc32586320f..2bd2294ac2a3 100644 > --- a/include/hw/ppc/pnv.h > +++ b/include/hw/ppc/pnv.h > @@ -58,6 +58,7 @@ typedef struct PnvChipClass { > uint64_t cores_mask; > =20 > void (*realize)(PnvChip *dev, Error **errp); > + uint32_t (*core_pir)(PnvChip *chip, uint32_t core_id); > } PnvChipClass; > =20 > #define TYPE_PNV_CHIP_POWER8E TYPE_PNV_CHIP "-POWER8E" --=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 --ceI9FlwgjS98XxYT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX4eJfAAoJEGw4ysog2bOSgSYP/jETQ1e8Z28p0+7S8rIVmbD/ OfYZdM58+ZXbr9OdSSHENp+G6YcJy/qXgCbXbNexjdHUiSj5zaHKzKAfgnvh2N+q R/4baSK3nv0lrodDJFgKEhmZbRQK3/VTTNl9+bAW7+ubvw7q0oGEIxlW/er83ZPl OKstBhCw+O10LNjl9WKkbxy8NfXMLlWvIFXg1qQp64GCYiyWdLToZDDao4q/Eu9p DG9c7BcEvKBWrfQz0Wj7R0/ZFL9J2xva2SJHnBVjn1KyC0fFGTfeczUERtp96CE5 5rYlIcSrJmJGTdbLCoV3mRY8MXoOqzmjvP4YQWj8MGID8IVJsBWzBNH976qm0iIJ /BBJ0WYoBYbux6iNeOOBHv0JeBfzQBKTCKH4ukXb8AjW2QYBKZQprInfeROos4mO 7T+HJ2/N0Z9NrhVR6DYEIH+d1fJv5u9GYidy45HRednEw1qxQ64Dtk4HbnFN46S6 l++mtaCIJz5Aj4Zi/qXM4ch1bi+5hR9HI+PYorJfp4vQYq/LGLyLQNaYJSSu4S1k zA0kAK4il63BGFMgUXeTbvBPwTgjIxxc/+5Cn6AfqOVelARipTBdnw44rjJNZL/+ AJeyR5wmuxD2XqECWF2bASwyZTwBPt/LMK5acIILPhRPa46Ha4bn8BYK5JSBm7w3 aIIWhJWPN+AwAcDazoG3 =atJz -----END PGP SIGNATURE----- --ceI9FlwgjS98XxYT--