From nobody Fri May 3 21:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516039576517108.1383729353762; Mon, 15 Jan 2018 10:06:16 -0800 (PST) Received: from localhost ([::1]:51870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb99D-0003Ri-NY for importer@patchew.org; Mon, 15 Jan 2018 13:06:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb97O-0001v1-Oc for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb97L-00074t-KU for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:22 -0500 Received: from 3.mo173.mail-out.ovh.net ([46.105.34.1]:35885) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb97L-00073O-Ey for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:19 -0500 Received: from player687.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 06A6797CF4 for ; Mon, 15 Jan 2018 19:04:18 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2226-150.w90-76.abo.wanadoo.fr [90.76.48.150]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id DA4282C00B7; Mon, 15 Jan 2018 19:04:13 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Mon, 15 Jan 2018 19:04:01 +0100 Message-Id: <20180115180406.28489-2-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115180406.28489-1-clg@kaod.org> References: <20180115180406.28489-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17086938462924147539 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrleekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.34.1 Subject: [Qemu-devel] [PATCH 1/6] ppc/pnv: use POWER9 DD2 processor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" commit 1ed9c8af501f ("target/ppc: Add POWER9 DD2.0 model information") deprecated the POWER9 model v1.0. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 2 +- tests/pnv-xscom-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 9475e8479c37..536162b2747c 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -759,7 +759,7 @@ static void pnv_chip_power9_class_init(ObjectClass *kla= ss, void *data) PnvChipClass *k =3D PNV_CHIP_CLASS(klass); =20 k->chip_type =3D PNV_CHIP_POWER9; - k->chip_cfam_id =3D 0x100d104980000000ull; /* P9 Nimbus DD1.0 */ + k->chip_cfam_id =3D 0x220d104900008000ull; /* P9 Nimbus DD2.0 */ k->cores_mask =3D POWER9_CORE_MASK; k->core_pir =3D pnv_chip_core_pir_p9; k->xscom_base =3D 0x00603fc00000000ull; diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c index 89fa6282d3af..a1a119c0912c 100644 --- a/tests/pnv-xscom-test.c +++ b/tests/pnv-xscom-test.c @@ -48,7 +48,7 @@ static const PnvChip pnv_chips[] =3D { .cpu_model =3D "POWER9", .xscom_base =3D 0x000603fc00000000ull, .xscom_core_base =3D 0x0ull, - .cfam_id =3D 0x100d104980000000ull, + .cfam_id =3D 0x220d104900008000ull, .first_core =3D 0x20, }, #endif --=20 2.13.6 From nobody Fri May 3 21:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516039713802972.4941175159056; Mon, 15 Jan 2018 10:08:33 -0800 (PST) Received: from localhost ([::1]:51914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9BQ-0005Kg-2O for importer@patchew.org; Mon, 15 Jan 2018 13:08:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb97Q-0001wl-JL for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb97P-00078v-Lu for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:24 -0500 Received: from 5.mo173.mail-out.ovh.net ([46.105.40.148]:32784) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb97P-00077j-G1 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:23 -0500 Received: from player687.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 438D39FE70 for ; Mon, 15 Jan 2018 19:04:22 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2226-150.w90-76.abo.wanadoo.fr [90.76.48.150]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 0A2022C0085; Mon, 15 Jan 2018 19:04:18 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Mon, 15 Jan 2018 19:04:02 +0100 Message-Id: <20180115180406.28489-3-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115180406.28489-1-clg@kaod.org> References: <20180115180406.28489-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17088345839487322963 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrleekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.40.148 Subject: [Qemu-devel] [PATCH 2/6] ppc/pnv: change core mask for POWER9 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When addressed by XSCOM, the first core has the 0x20 chiplet ID but the CPU PIR can start at 0x0. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 4 ++-- tests/pnv-xscom-test.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 536162b2747c..f9591cd41d36 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -707,9 +707,9 @@ static uint32_t pnv_chip_core_pir_p9(PnvChip *chip, uin= t32_t core_id) #define POWER8_CORE_MASK (0x7e7eull) =20 /* - * POWER9 has 24 cores, ids starting at 0x20 + * POWER9 has 24 cores, ids starting at 0x0 */ -#define POWER9_CORE_MASK (0xffffff00000000ull) +#define POWER9_CORE_MASK (0xffffffffffffffull) =20 static void pnv_chip_power8e_class_init(ObjectClass *klass, void *data) { diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c index a1a119c0912c..9d545c471813 100644 --- a/tests/pnv-xscom-test.c +++ b/tests/pnv-xscom-test.c @@ -49,7 +49,7 @@ static const PnvChip pnv_chips[] =3D { .xscom_base =3D 0x000603fc00000000ull, .xscom_core_base =3D 0x0ull, .cfam_id =3D 0x220d104900008000ull, - .first_core =3D 0x20, + .first_core =3D 0x0, }, #endif }; --=20 2.13.6 From nobody Fri May 3 21:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516039713745145.4425020961737; Mon, 15 Jan 2018 10:08:33 -0800 (PST) Received: from localhost ([::1]:51916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9BP-0005L5-Tk for importer@patchew.org; Mon, 15 Jan 2018 13:08:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb97U-00022F-OR for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb97T-0007Bn-Rq for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:28 -0500 Received: from 10.mo173.mail-out.ovh.net ([46.105.74.148]:39371) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb97T-0007BN-KR for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:27 -0500 Received: from player687.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 681469FFCB for ; Mon, 15 Jan 2018 19:04:26 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2226-150.w90-76.abo.wanadoo.fr [90.76.48.150]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 2DD9A2C0085; Mon, 15 Jan 2018 19:04:22 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Mon, 15 Jan 2018 19:04:03 +0100 Message-Id: <20180115180406.28489-4-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115180406.28489-1-clg@kaod.org> References: <20180115180406.28489-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17089471736249682771 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrleekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.74.148 Subject: [Qemu-devel] [PATCH 3/6] ppc/pnv: introduce pnv*_is_power9() helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" These are useful when instantiating device models which are shared between the POWER8 and the POWER9 processor families. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv_xscom.c | 8 +++----- include/hw/ppc/pnv.h | 10 ++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index e51d634f4062..99c40efecdf9 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -51,10 +51,9 @@ static void xscom_complete(CPUState *cs, uint64_t hmer_b= its) =20 static uint32_t pnv_xscom_pcba(PnvChip *chip, uint64_t addr) { - PnvChipClass *pcc =3D PNV_CHIP_GET_CLASS(chip); - addr &=3D (PNV_XSCOM_SIZE - 1); - if (pcc->chip_type =3D=3D PNV_CHIP_POWER9) { + + if (pnv_chip_is_power9(chip)) { return addr >> 3; } else { return ((addr >> 4) & ~0xfull) | ((addr >> 3) & 0xf); @@ -231,7 +230,6 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_off= set) int xscom_offset; ForeachPopulateArgs args; char *name; - PnvChipClass *pcc =3D PNV_CHIP_GET_CLASS(chip); =20 name =3D g_strdup_printf("xscom@%" PRIx64, be64_to_cpu(reg[0])); xscom_offset =3D fdt_add_subnode(fdt, root_offset, name); @@ -242,7 +240,7 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_off= set) _FDT((fdt_setprop_cell(fdt, xscom_offset, "#size-cells", 1))); _FDT((fdt_setprop(fdt, xscom_offset, "reg", reg, sizeof(reg)))); =20 - if (pcc->chip_type =3D=3D PNV_CHIP_POWER9) { + if (pnv_chip_is_power9(chip)) { _FDT((fdt_setprop(fdt, xscom_offset, "compatible", compat_p9, sizeof(compat_p9)))); } else { diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 61896f9fd767..f023f1ec99c0 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -138,6 +138,16 @@ typedef struct PnvMachineState { Notifier powerdown_notifier; } PnvMachineState; =20 +static inline bool pnv_chip_is_power9(const PnvChip *chip) +{ + return PNV_CHIP_GET_CLASS(chip)->chip_type =3D=3D PNV_CHIP_POWER9; +} + +static inline bool pnv_is_power9(PnvMachineState *pnv) +{ + return pnv_chip_is_power9(pnv->chips[0]); +} + #define PNV_FDT_ADDR 0x01000000 #define PNV_TIMEBASE_FREQ 512000000ULL =20 --=20 2.13.6 From nobody Fri May 3 21:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516039832122858.377764825081; Mon, 15 Jan 2018 10:10:32 -0800 (PST) Received: from localhost ([::1]:52099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9DH-000701-An for importer@patchew.org; Mon, 15 Jan 2018 13:10:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb97Z-00028p-7p for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb97X-0007EW-SN for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:33 -0500 Received: from 9.mo173.mail-out.ovh.net ([46.105.72.44]:44114) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb97X-0007Da-IS for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:31 -0500 Received: from player687.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 728D8A253F for ; Mon, 15 Jan 2018 19:04:30 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2226-150.w90-76.abo.wanadoo.fr [90.76.48.150]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 5104A2C009D; Mon, 15 Jan 2018 19:04:26 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Mon, 15 Jan 2018 19:04:04 +0100 Message-Id: <20180115180406.28489-5-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115180406.28489-1-clg@kaod.org> References: <20180115180406.28489-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17090597639122684755 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrleekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.72.44 Subject: [Qemu-devel] [PATCH 4/6] ppc/pnv: fix XSCOM core addressing on POWER9 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The XSCOM base address of the core chiplet was wrongly calculated. Use the OPAL macros to fix that and do a couple of renames. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 15 ++++++++------- hw/ppc/pnv_core.c | 2 +- include/hw/ppc/pnv.h | 1 - include/hw/ppc/pnv_xscom.h | 13 +++++++++++-- tests/pnv-xscom-test.c | 27 +++++++++++++++++---------- 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index f9591cd41d36..80245f57f1ae 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -721,7 +721,6 @@ static void pnv_chip_power8e_class_init(ObjectClass *kl= ass, void *data) k->cores_mask =3D POWER8E_CORE_MASK; k->core_pir =3D pnv_chip_core_pir_p8; k->xscom_base =3D 0x003fc0000000000ull; - k->xscom_core_base =3D 0x10000000ull; dc->desc =3D "PowerNV Chip POWER8E"; } =20 @@ -735,7 +734,6 @@ static void pnv_chip_power8_class_init(ObjectClass *kla= ss, void *data) k->cores_mask =3D POWER8_CORE_MASK; k->core_pir =3D pnv_chip_core_pir_p8; k->xscom_base =3D 0x003fc0000000000ull; - k->xscom_core_base =3D 0x10000000ull; dc->desc =3D "PowerNV Chip POWER8"; } =20 @@ -749,7 +747,6 @@ static void pnv_chip_power8nvl_class_init(ObjectClass *= klass, void *data) k->cores_mask =3D POWER8_CORE_MASK; k->core_pir =3D pnv_chip_core_pir_p8; k->xscom_base =3D 0x003fc0000000000ull; - k->xscom_core_base =3D 0x10000000ull; dc->desc =3D "PowerNV Chip POWER8NVL"; } =20 @@ -763,7 +760,6 @@ static void pnv_chip_power9_class_init(ObjectClass *kla= ss, void *data) k->cores_mask =3D POWER9_CORE_MASK; k->core_pir =3D pnv_chip_core_pir_p9; k->xscom_base =3D 0x00603fc00000000ull; - k->xscom_core_base =3D 0x0ull; dc->desc =3D "PowerNV Chip POWER9"; } =20 @@ -887,6 +883,7 @@ static void pnv_chip_realize(DeviceState *dev, Error **= errp) && (i < chip->nr_cores); core_hwid++) { char core_name[32]; void *pnv_core =3D chip->cores + i * typesize; + uint64_t xscom_core_base; =20 if (!(chip->cores_mask & (1ull << core_hwid))) { continue; @@ -910,9 +907,13 @@ static void pnv_chip_realize(DeviceState *dev, Error *= *errp) object_unref(OBJECT(pnv_core)); =20 /* Each core has an XSCOM MMIO region */ - pnv_xscom_add_subregion(chip, - PNV_XSCOM_EX_CORE_BASE(pcc->xscom_core_bas= e, - core_hwid), + if (!pnv_chip_is_power9(chip)) { + xscom_core_base =3D PNV_XSCOM_EX_BASE(core_hwid); + } else { + xscom_core_base =3D PNV_XSCOM_P9_EC_BASE(core_hwid); + } + + pnv_xscom_add_subregion(chip, xscom_core_base, &PNV_CORE(pnv_core)->xscom_regs); i++; } diff --git a/hw/ppc/pnv_core.c b/hw/ppc/pnv_core.c index 7e8a76df4472..cbb64ad9e7e0 100644 --- a/hw/ppc/pnv_core.c +++ b/hw/ppc/pnv_core.c @@ -192,7 +192,7 @@ static void pnv_core_realize(DeviceState *dev, Error **= errp) =20 snprintf(name, sizeof(name), "xscom-core.%d", cc->core_id); pnv_xscom_region_init(&pc->xscom_regs, OBJECT(dev), &pnv_core_xscom_op= s, - pc, name, PNV_XSCOM_EX_CORE_SIZE); + pc, name, PNV_XSCOM_EX_SIZE); return; =20 err: diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index f023f1ec99c0..90759240a7b1 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -74,7 +74,6 @@ typedef struct PnvChipClass { uint64_t cores_mask; =20 hwaddr xscom_base; - hwaddr xscom_core_base; =20 uint32_t (*core_pir)(PnvChip *chip, uint32_t core_id); } PnvChipClass; diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h index 7252e219e249..fb1bd5df095a 100644 --- a/include/hw/ppc/pnv_xscom.h +++ b/include/hw/ppc/pnv_xscom.h @@ -21,6 +21,8 @@ =20 #include "qom/object.h" =20 +typedef struct PnvChip PnvChip; + typedef struct PnvXScomInterface { Object parent; } PnvXScomInterface; @@ -54,8 +56,15 @@ typedef struct PnvXScomInterfaceClass { * PCB SLAVE 0x110Fxxxx */ =20 -#define PNV_XSCOM_EX_CORE_BASE(base, i) ((base) | ((uint64_t)(i) << 24)) -#define PNV_XSCOM_EX_CORE_SIZE 0x100000 +#define PNV_XSCOM_EX_CORE_BASE 0x10000000ull + +#define PNV_XSCOM_EX_BASE(core) \ + (PNV_XSCOM_EX_CORE_BASE | ((uint64_t)(core) << 24)) +#define PNV_XSCOM_EX_SIZE 0x100000 + +#define PNV_XSCOM_P9_EC_BASE(core) \ + ((uint64_t)(((core) & 0x1F) + 0x20) << 24) +#define PNV_XSCOM_P9_EC_SIZE 0x100000 =20 #define PNV_XSCOM_LPC_BASE 0xb0020 #define PNV_XSCOM_LPC_SIZE 0x4 diff --git a/tests/pnv-xscom-test.c b/tests/pnv-xscom-test.c index 9d545c471813..efb7c838b5c0 100644 --- a/tests/pnv-xscom-test.c +++ b/tests/pnv-xscom-test.c @@ -21,7 +21,6 @@ typedef struct PnvChip { PnvChipType chip_type; const char *cpu_model; uint64_t xscom_base; - uint64_t xscom_core_base; uint64_t cfam_id; uint32_t first_core; } PnvChip; @@ -31,14 +30,12 @@ static const PnvChip pnv_chips[] =3D { .chip_type =3D PNV_CHIP_POWER8, .cpu_model =3D "POWER8", .xscom_base =3D 0x0003fc0000000000ull, - .xscom_core_base =3D 0x10000000ull, .cfam_id =3D 0x220ea04980000000ull, .first_core =3D 0x1, }, { .chip_type =3D PNV_CHIP_POWER8NVL, .cpu_model =3D "POWER8NVL", .xscom_base =3D 0x0003fc0000000000ull, - .xscom_core_base =3D 0x10000000ull, .cfam_id =3D 0x120d304980000000ull, .first_core =3D 0x1, }, @@ -47,7 +44,6 @@ static const PnvChip pnv_chips[] =3D { .chip_type =3D PNV_CHIP_POWER9, .cpu_model =3D "POWER9", .xscom_base =3D 0x000603fc00000000ull, - .xscom_core_base =3D 0x0ull, .cfam_id =3D 0x220d104900008000ull, .first_core =3D 0x0, }, @@ -89,16 +85,27 @@ static void test_cfam_id(const void *data) qtest_quit(global_qtest); } =20 -#define PNV_XSCOM_EX_CORE_BASE(chip, i) \ - ((chip)->xscom_core_base | (((uint64_t)i) << 24)) + +#define PNV_XSCOM_EX_CORE_BASE 0x10000000ull +#define PNV_XSCOM_EX_BASE(core) \ + (PNV_XSCOM_EX_CORE_BASE | ((uint64_t)(core) << 24)) +#define PNV_XSCOM_P9_EC_BASE(core) \ + ((uint64_t)(((core) & 0x1F) + 0x20) << 24) + #define PNV_XSCOM_EX_DTS_RESULT0 0x50000 =20 static void test_xscom_core(const PnvChip *chip) { - uint32_t first_core_dts0 =3D - PNV_XSCOM_EX_CORE_BASE(chip, chip->first_core) | - PNV_XSCOM_EX_DTS_RESULT0; - uint64_t dts0 =3D pnv_xscom_read(chip, first_core_dts0); + uint32_t first_core_dts0 =3D PNV_XSCOM_EX_DTS_RESULT0; + uint64_t dts0; + + if (chip->chip_type !=3D PNV_CHIP_POWER9) { + first_core_dts0 |=3D PNV_XSCOM_EX_BASE(chip->first_core); + } else { + first_core_dts0 |=3D PNV_XSCOM_P9_EC_BASE(chip->first_core); + } + + dts0 =3D pnv_xscom_read(chip, first_core_dts0); =20 g_assert_cmphex(dts0, =3D=3D, 0x26f024f023f0000ull); } --=20 2.13.6 From nobody Fri May 3 21:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516039652077255.79304120098118; Mon, 15 Jan 2018 10:07:32 -0800 (PST) Received: from localhost ([::1]:51899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9AR-0004TD-2y for importer@patchew.org; Mon, 15 Jan 2018 13:07:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb97f-0002Fy-Dm for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb97c-0007Iw-9b for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:39 -0500 Received: from 7.mo173.mail-out.ovh.net ([46.105.44.159]:42820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb97c-0007HV-2x for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:36 -0500 Received: from player687.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id 9FFD7A27D3 for ; Mon, 15 Jan 2018 19:04:34 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2226-150.w90-76.abo.wanadoo.fr [90.76.48.150]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 73D8A2C009D; Mon, 15 Jan 2018 19:04:30 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Mon, 15 Jan 2018 19:04:05 +0100 Message-Id: <20180115180406.28489-6-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115180406.28489-1-clg@kaod.org> References: <20180115180406.28489-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17091723537538059091 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrleekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.44.159 Subject: [Qemu-devel] [PATCH 5/6] ppc/pnv: change initrd address X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When skiboot starts, it first clears the CPU structs for all possible CPUs on a system : for (i =3D 0; i <=3D cpu_max_pir; i++) memset(&cpu_stacks[i].cpu, 0, sizeof(struct cpu_thread)); On POWER9, cpu_max_pir is quite big, 0x7fff, and the skiboot cpu_stacks array overlaps with the memory region in which QEMU maps the initramfs file. Move it upwards in memory to keep it safe. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 80245f57f1ae..98ee3c607ae7 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -53,7 +53,7 @@ #define FW_MAX_SIZE 0x00400000 =20 #define KERNEL_LOAD_ADDR 0x20000000 -#define INITRD_LOAD_ADDR 0x40000000 +#define INITRD_LOAD_ADDR 0x60000000 =20 static const char *pnv_chip_core_typename(const PnvChip *o) { --=20 2.13.6 From nobody Fri May 3 21:09:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516039944334435.99176293968594; Mon, 15 Jan 2018 10:12:24 -0800 (PST) Received: from localhost ([::1]:52194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb9F9-0000GU-E8 for importer@patchew.org; Mon, 15 Jan 2018 13:12:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eb97s-0002UR-CO for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eb97o-0007Sv-GK for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:51 -0500 Received: from 4.mo173.mail-out.ovh.net ([46.105.34.219]:33183) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eb97o-0007SQ-AF for qemu-devel@nongnu.org; Mon, 15 Jan 2018 13:04:48 -0500 Received: from player687.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo173.mail-out.ovh.net (Postfix) with ESMTP id D5B35A29D2 for ; Mon, 15 Jan 2018 19:04:38 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2226-150.w90-76.abo.wanadoo.fr [90.76.48.150]) (Authenticated sender: clg@kaod.org) by player687.ha.ovh.net (Postfix) with ESMTPSA id 97F442C00B7; Mon, 15 Jan 2018 19:04:34 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Date: Mon, 15 Jan 2018 19:04:06 +0100 Message-Id: <20180115180406.28489-7-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115180406.28489-1-clg@kaod.org> References: <20180115180406.28489-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17092849438995942227 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrleekgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.34.219 Subject: [Qemu-devel] [PATCH 6/6] target/ppc: add support for POWER9 HILE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: C=C3=A9dric Le Goater --- target/ppc/cpu.h | 1 + target/ppc/excp_helper.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index dc6820c5eb99..14aaa87fe825 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -2012,6 +2012,7 @@ void ppc_compat_add_property(Object *obj, const char = *name, #define HID0_DOZE (1 << 23) /* pre-2.06 */ #define HID0_NAP (1 << 22) /* pre-2.06 */ #define HID0_HILE PPC_BIT(19) /* POWER8 */ +#define HID0_POWER9_HILE PPC_BIT(4) =20 /*************************************************************************= ****/ /* PowerPC Instructions types definitions = */ diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 37d241072685..4e548a448747 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -654,7 +654,7 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int ex= cp_model, int excp) } } else if (excp_model =3D=3D POWERPC_EXCP_POWER8) { if (new_msr & MSR_HVB) { - if (env->spr[SPR_HID0] & HID0_HILE) { + if (env->spr[SPR_HID0] & (HID0_HILE | HID0_POWER9_HILE)) { new_msr |=3D (target_ulong)1 << MSR_LE; } } else if (env->spr[SPR_LPCR] & LPCR_ILE) { --=20 2.13.6