qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH 03/10] ppc/pnv: Introduce a "xics" property alias under the PSI model
Date: Thu, 19 Dec 2019 16:25:50 +0100	[thread overview]
Message-ID: <20191219162550.42204337@bahia.lan> (raw)
In-Reply-To: <20191219073001.26790-4-clg@kaod.org>

On Thu, 19 Dec 2019 08:29:54 +0100
Cédric Le Goater <clg@kaod.org> wrote:

> This removes the need of the intermediate link under PSI to pass the
> XICS link to the underlying ICSState object.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  hw/ppc/pnv.c     |  4 ++--
>  hw/ppc/pnv_psi.c | 11 ++---------
>  2 files changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
> index 2f611bfdda46..d6fe5ba13535 100644
> --- a/hw/ppc/pnv.c
> +++ b/hw/ppc/pnv.c
> @@ -999,8 +999,6 @@ static void pnv_chip_power8_instance_init(Object *obj)
>  
>      object_initialize_child(obj, "psi",  &chip8->psi, sizeof(chip8->psi),
>                              TYPE_PNV8_PSI, &error_abort, NULL);
> -    object_property_add_const_link(OBJECT(&chip8->psi), "xics",
> -                                   OBJECT(qdev_get_machine()), &error_abort);
>  
>      object_initialize_child(obj, "lpc",  &chip8->lpc, sizeof(chip8->lpc),
>                              TYPE_PNV8_LPC, &error_abort, NULL);
> @@ -1069,6 +1067,8 @@ static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
>                              "bar", &error_fatal);
>      object_property_set_link(OBJECT(&chip8->psi), OBJECT(chip->system_memory),
>                               "system-memory", &error_abort);
> +    object_property_set_link(OBJECT(&chip8->psi), OBJECT(qdev_get_machine()),
> +                             ICS_PROP_XICS, &error_abort);
>      object_property_set_bool(OBJECT(&chip8->psi), true, "realized", &local_err);
>      if (local_err) {
>          error_propagate(errp, local_err);
> diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
> index 28d34e5c193a..d3124f673571 100644
> --- a/hw/ppc/pnv_psi.c
> +++ b/hw/ppc/pnv_psi.c
> @@ -470,6 +470,8 @@ static void pnv_psi_power8_instance_init(Object *obj)
>  
>      object_initialize_child(obj, "ics-psi",  &psi8->ics, sizeof(psi8->ics),
>                              TYPE_ICS, &error_abort, NULL);
> +    object_property_add_alias(obj, ICS_PROP_XICS, OBJECT(&psi8->ics),
> +                              ICS_PROP_XICS, &error_abort);
>  }
>  
>  static const uint8_t irq_to_xivr[] = {
> @@ -485,21 +487,12 @@ static void pnv_psi_power8_realize(DeviceState *dev, Error **errp)
>  {
>      PnvPsi *psi = PNV_PSI(dev);
>      ICSState *ics = &PNV8_PSI(psi)->ics;
> -    Object *obj;
>      Error *err = NULL;
>      unsigned int i;
>  
>      assert(psi->system_memory);
>  
> -    obj = object_property_get_link(OBJECT(dev), "xics", &err);
> -    if (!obj) {
> -        error_setg(errp, "%s: required link 'xics' not found: %s",
> -                   __func__, error_get_pretty(err));
> -        return;
> -    }
> -
>      /* Create PSI interrupt control source */
> -    object_property_set_link(OBJECT(ics), obj, ICS_PROP_XICS, &error_abort);
>      object_property_set_int(OBJECT(ics), PSI_NUM_INTERRUPTS, "nr-irqs", &err);
>      if (err) {
>          error_propagate(errp, err);



  reply	other threads:[~2019-12-19 15:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19  7:29 [PATCH 00/10] ppc/pnv: remove the use of qdev_get_machine() and get_system_memory() Cédric Le Goater
2019-12-19  7:29 ` [PATCH 01/10] ppc/pnv: Modify the powerdown notifier to get the PowerNV machine Cédric Le Goater
2019-12-19 14:54   ` Greg Kurz
2019-12-19  7:29 ` [PATCH 02/10] ppc/pnv: Introduce a "system-memory" property Cédric Le Goater
2019-12-19 16:01   ` Greg Kurz
2019-12-19 17:57     ` Cédric Le Goater
2019-12-19  7:29 ` [PATCH 03/10] ppc/pnv: Introduce a "xics" property alias under the PSI model Cédric Le Goater
2019-12-19 15:25   ` Greg Kurz [this message]
2019-12-19  7:29 ` [PATCH 04/10] ppc/pnv: Introduce a "xics" property under the POWER8 chip Cédric Le Goater
2019-12-19 15:28   ` Greg Kurz
2019-12-19  7:29 ` [PATCH 05/10] spapr/xive: Use device_class_set_parent_realize() Cédric Le Goater
2019-12-19  7:29 ` [PATCH 06/10] pnv/xive: " Cédric Le Goater
2019-12-19  7:29 ` [PATCH 07/10] spapr, pnv, xive: Add a "xive-fabric" link to the XIVE router Cédric Le Goater
2019-12-19  7:29 ` [PATCH 08/10] xive: Use the XIVE fabric link under " Cédric Le Goater
2019-12-19  7:30 ` [PATCH 09/10] ppc/pnv: Add an "nr-threads" property to the base chip class Cédric Le Goater
2019-12-19  7:30 ` [PATCH 10/10] ppc/pnv: Add a "pnor" const link property to the BMC internal simulator Cédric Le Goater

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=20191219162550.42204337@bahia.lan \
    --to=groug@kaod.org \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --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).