From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: "Cédric Le Goater" <clg@kaod.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
Frederic Barrat <fbarrat@linux.ibm.com>,
Greg Kurz <groug@kaod.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH v3 08/18] ppc/psi: Add support for StoreEOI and 64k ESB pages (POWER10)
Date: Fri, 25 Feb 2022 11:11:56 -0300 [thread overview]
Message-ID: <5c2a720b-b792-0871-0bc4-d0a99448d81c@gmail.com> (raw)
In-Reply-To: <20211126115349.2737605-9-clg@kaod.org>
On 11/26/21 08:53, Cédric Le Goater wrote:
> POWER10 adds support for StoreEOI operation and 64K ESB pages on PSIHB
> to be consistent with the other interrupt sources of the system.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> hw/ppc/pnv.c | 6 ++++++
> hw/ppc/pnv_psi.c | 30 ++++++++++++++++++++++++------
> 2 files changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index d510d2e1d917..96c908c753cb 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -1526,6 +1526,9 @@ static void pnv_chip_power9_realize(DeviceState *dev, Error **errp)
> /* Processor Service Interface (PSI) Host Bridge */
> object_property_set_int(OBJECT(&chip9->psi), "bar", PNV9_PSIHB_BASE(chip),
> &error_fatal);
> + /* This is the only device with 4k ESB pages */
> + object_property_set_int(OBJECT(&chip9->psi), "shift", XIVE_ESB_4K,
> + &error_fatal);
> if (!qdev_realize(DEVICE(&chip9->psi), NULL, errp)) {
> return;
> }
> @@ -1768,6 +1771,9 @@ static void pnv_chip_power10_realize(DeviceState *dev, Error **errp)
> /* Processor Service Interface (PSI) Host Bridge */
> object_property_set_int(OBJECT(&chip10->psi), "bar",
> PNV10_PSIHB_BASE(chip), &error_fatal);
> + /* PSI can now be configured to use 64k ESB pages on POWER10 */
> + object_property_set_int(OBJECT(&chip10->psi), "shift", XIVE_ESB_64K,
> + &error_fatal);
> if (!qdev_realize(DEVICE(&chip10->psi), NULL, errp)) {
> return;
> }
> diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
> index cd9a2c5952a6..737486046d5a 100644
> --- a/hw/ppc/pnv_psi.c
> +++ b/hw/ppc/pnv_psi.c
> @@ -601,7 +601,6 @@ static const TypeInfo pnv_psi_power8_info = {
> #define PSIHB9_IRQ_METHOD PPC_BIT(0)
> #define PSIHB9_IRQ_RESET PPC_BIT(1)
> #define PSIHB9_ESB_CI_BASE 0x60
> -#define PSIHB9_ESB_CI_64K PPC_BIT(1)
> #define PSIHB9_ESB_CI_ADDR_MASK PPC_BITMASK(8, 47)
> #define PSIHB9_ESB_CI_VALID PPC_BIT(63)
> #define PSIHB9_ESB_NOTIF_ADDR 0x68
> @@ -646,6 +645,14 @@ static const TypeInfo pnv_psi_power8_info = {
> #define PSIHB9_IRQ_STAT_DIO PPC_BIT(12)
> #define PSIHB9_IRQ_STAT_PSU PPC_BIT(13)
>
> +/* P10 register extensions */
> +
> +#define PSIHB10_CR PSIHB9_CR
> +#define PSIHB10_CR_STORE_EOI PPC_BIT(12)
> +
> +#define PSIHB10_ESB_CI_BASE PSIHB9_ESB_CI_BASE
> +#define PSIHB10_ESB_CI_64K PPC_BIT(1)
> +
> static void pnv_psi_notify(XiveNotifier *xf, uint32_t srcno)
> {
> PnvPsi *psi = PNV_PSI(xf);
> @@ -704,6 +711,13 @@ static void pnv_psi_p9_mmio_write(void *opaque, hwaddr addr,
>
> switch (addr) {
> case PSIHB9_CR:
> + if (val & PSIHB10_CR_STORE_EOI) {
> + psi9->source.esb_flags |= XIVE_SRC_STORE_EOI;
> + } else {
> + psi9->source.esb_flags &= ~XIVE_SRC_STORE_EOI;
> + }
> + break;
> +
> case PSIHB9_SEMR:
> /* FSP stuff */
> break;
> @@ -715,15 +729,20 @@ static void pnv_psi_p9_mmio_write(void *opaque, hwaddr addr,
> break;
>
> case PSIHB9_ESB_CI_BASE:
> + if (val & PSIHB10_ESB_CI_64K) {
> + psi9->source.esb_shift = XIVE_ESB_64K;
> + } else {
> + psi9->source.esb_shift = XIVE_ESB_4K;
> + }
> if (!(val & PSIHB9_ESB_CI_VALID)) {
> if (psi->regs[reg] & PSIHB9_ESB_CI_VALID) {
> memory_region_del_subregion(sysmem, &psi9->source.esb_mmio);
> }
> } else {
> if (!(psi->regs[reg] & PSIHB9_ESB_CI_VALID)) {
> - memory_region_add_subregion(sysmem,
> - val & ~PSIHB9_ESB_CI_VALID,
> - &psi9->source.esb_mmio);
> + hwaddr addr = val & ~(PSIHB9_ESB_CI_VALID | PSIHB10_ESB_CI_64K);
> + memory_region_add_subregion(sysmem, addr,
> + &psi9->source.esb_mmio);
> }
> }
> psi->regs[reg] = val;
> @@ -831,6 +850,7 @@ static void pnv_psi_power9_instance_init(Object *obj)
> Pnv9Psi *psi = PNV9_PSI(obj);
>
> object_initialize_child(obj, "source", &psi->source, TYPE_XIVE_SOURCE);
> + object_property_add_alias(obj, "shift", OBJECT(&psi->source), "shift");
> }
>
> static void pnv_psi_power9_realize(DeviceState *dev, Error **errp)
> @@ -839,8 +859,6 @@ static void pnv_psi_power9_realize(DeviceState *dev, Error **errp)
> XiveSource *xsrc = &PNV9_PSI(psi)->source;
> int i;
>
> - /* This is the only device with 4k ESB pages */
> - object_property_set_int(OBJECT(xsrc), "shift", XIVE_ESB_4K, &error_fatal);
> object_property_set_int(OBJECT(xsrc), "nr-irqs", PSIHB9_NUM_IRQS,
> &error_fatal);
> object_property_set_link(OBJECT(xsrc), "xive", OBJECT(psi), &error_abort);
next prev parent reply other threads:[~2022-02-25 14:48 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 11:53 [PATCH v3 00/18] ppc/pnv: Extend the powernv10 machine Cédric Le Goater
2021-11-26 11:53 ` [PATCH v3 01/18] ppc/xive2: Introduce a XIVE2 core framework Cédric Le Goater
2022-02-25 13:44 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 02/18] ppc/xive2: Introduce a presenter matching routine Cédric Le Goater
2022-02-25 13:44 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 03/18] ppc/pnv: Add a XIVE2 controller to the POWER10 chip Cédric Le Goater
2022-02-25 14:01 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 04/18] ppc/pnv: Add a OCC model for POWER10 Cédric Le Goater
2021-11-26 11:53 ` [PATCH v3 05/18] ppc/pnv: Add POWER10 quads Cédric Le Goater
2021-11-26 11:53 ` [PATCH v3 06/18] ppc/pnv: Add model for POWER10 PHB5 PCIe Host bridge Cédric Le Goater
2022-02-25 14:09 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 07/18] ppc/pnv: Add a HOMER model to POWER10 Cédric Le Goater
2021-11-26 11:53 ` [PATCH v3 08/18] ppc/psi: Add support for StoreEOI and 64k ESB pages (POWER10) Cédric Le Goater
2022-02-25 14:11 ` Daniel Henrique Barboza [this message]
2021-11-26 11:53 ` [PATCH v3 09/18] ppc/xive2: Add support for notification injection on ESB pages Cédric Le Goater
2022-02-25 14:18 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 10/18] ppc/xive: Add support for PQ state bits offload Cédric Le Goater
2022-02-25 16:00 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 11/18] ppc/pnv: Add support for PQ offload on PHB5 Cédric Le Goater
2022-02-25 16:06 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 12/18] ppc/pnv: Add support for PHB5 "Address-based trigger" mode Cédric Le Goater
2022-02-25 16:11 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 13/18] pnv/xive2: Introduce new capability bits Cédric Le Goater
2022-02-25 16:13 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 14/18] ppc/pnv: add XIVE Gen2 TIMA support Cédric Le Goater
2022-02-25 16:26 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 15/18] pnv/xive2: Add support XIVE2 P9-compat mode (or Gen1) Cédric Le Goater
2022-02-25 16:28 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 16/18] xive2: Add a get_config() handler for the router configuration Cédric Le Goater
2022-02-25 16:29 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 17/18] pnv/xive2: Add support for automatic save&restore Cédric Le Goater
2022-02-25 16:33 ` Daniel Henrique Barboza
2021-11-26 11:53 ` [PATCH v3 18/18] pnv/xive2: Add support for 8bits thread id Cédric Le Goater
2022-02-25 16:33 ` Daniel Henrique Barboza
2022-01-11 13:34 ` [PATCH v3 00/18] ppc/pnv: Extend the powernv10 machine Daniel Henrique Barboza
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5c2a720b-b792-0871-0bc4-d0a99448d81c@gmail.com \
--to=danielhb413@gmail.com \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=david@gibson.dropbear.id.au \
--cc=fbarrat@linux.ibm.com \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).