All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ppc/pnv: Final refinements on PHB4s
@ 2022-01-17 12:27 Cédric Le Goater
  2022-01-17 12:27 ` [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize() Cédric Le Goater
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Cédric Le Goater @ 2022-01-17 12:27 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel; +Cc: Daniel Henrique Barboza, Cédric Le Goater

Hello,

These are the last little tweaks on PHB4 to prepare ground for PHB5.

Thanks,

C. 

Cédric Le Goater (3):
  ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize()
  ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC
  ppc/pnv: Remove PHB4 version property

 include/hw/pci-host/pnv_phb4.h |  1 +
 hw/pci-host/pnv_phb4.c         | 16 +---------------
 hw/pci-host/pnv_phb4_pec.c     |  9 ++++++---
 3 files changed, 8 insertions(+), 18 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize()
  2022-01-17 12:27 [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
@ 2022-01-17 12:27 ` Cédric Le Goater
  2022-01-17 19:41   ` Daniel Henrique Barboza
  2022-01-17 12:27 ` [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC Cédric Le Goater
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Cédric Le Goater @ 2022-01-17 12:27 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel; +Cc: Daniel Henrique Barboza, Cédric Le Goater

The root port device is currently created and attached to the PHB
early in pnv_phb4_realize(). Do it under pnv_pec_default_phb_realize()
after the PHB is fully realized. It's cleaner and avoids an extra
test on defaults_enabled().

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/pci-host/pnv_phb4.c     | 7 -------
 hw/pci-host/pnv_phb4_pec.c | 3 +++
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index 1db815b1aba0..c688976caec9 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -22,7 +22,6 @@
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
 #include "qom/object.h"
-#include "sysemu/sysemu.h"
 #include "trace.h"
 
 #define phb_error(phb, fmt, ...)                                        \
@@ -1639,12 +1638,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
     pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
     pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
 
-    /* Add a single Root port if running with defaults */
-    if (defaults_enabled()) {
-        pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb),
-                                 TYPE_PNV_PHB4_ROOT_PORT);
-    }
-
     /* Setup XIVE Source */
     if (phb->big_phb) {
         nr_irqs = PNV_PHB4_MAX_INTs;
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index 12aa4596282b..b19e89236a63 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -132,6 +132,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
     if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) {
         return;
     }
+
+    /* Add a single Root port if running with defaults */
+    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT);
 }
 
 static void pnv_pec_realize(DeviceState *dev, Error **errp)
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC
  2022-01-17 12:27 [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
  2022-01-17 12:27 ` [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize() Cédric Le Goater
@ 2022-01-17 12:27 ` Cédric Le Goater
  2022-01-17 19:44   ` Daniel Henrique Barboza
  2022-01-17 12:27 ` [PATCH 3/3] ppc/pnv: Remove PHB4 version property Cédric Le Goater
  2022-01-18 12:01 ` [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
  3 siblings, 1 reply; 9+ messages in thread
From: Cédric Le Goater @ 2022-01-17 12:27 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel; +Cc: Daniel Henrique Barboza, Cédric Le Goater

PHB5 will introduce its own root port model. Prepare ground for it.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 include/hw/pci-host/pnv_phb4.h | 1 +
 hw/pci-host/pnv_phb4_pec.c     | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
index 74fdec2b478b..0c7635dec591 100644
--- a/include/hw/pci-host/pnv_phb4.h
+++ b/include/hw/pci-host/pnv_phb4.h
@@ -203,6 +203,7 @@ struct PnvPhb4PecClass {
     int stk_compat_size;
     uint64_t version;
     const uint32_t *num_phbs;
+    const char *rp_model;
 };
 
 #endif /* PCI_HOST_PNV_PHB4_H */
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index b19e89236a63..a3c4b4ef850c 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -134,7 +134,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
     }
 
     /* Add a single Root port if running with defaults */
-    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT);
+    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb),
+                             PNV_PHB4_PEC_GET_CLASS(pec)->rp_model);
+
 }
 
 static void pnv_pec_realize(DeviceState *dev, Error **errp)
@@ -267,6 +269,7 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
     pecc->stk_compat_size = sizeof(stk_compat);
     pecc->version = PNV_PHB4_VERSION;
     pecc->num_phbs = pnv_pec_num_phbs;
+    pecc->rp_model = TYPE_PNV_PHB4_ROOT_PORT;
 }
 
 static const TypeInfo pnv_pec_type_info = {
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] ppc/pnv: Remove PHB4 version property
  2022-01-17 12:27 [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
  2022-01-17 12:27 ` [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize() Cédric Le Goater
  2022-01-17 12:27 ` [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC Cédric Le Goater
@ 2022-01-17 12:27 ` Cédric Le Goater
  2022-01-17 19:50   ` Daniel Henrique Barboza
  2022-01-18 12:01 ` [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
  3 siblings, 1 reply; 9+ messages in thread
From: Cédric Le Goater @ 2022-01-17 12:27 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel; +Cc: Daniel Henrique Barboza, Cédric Le Goater

and grab the PHB version from the PEC class directly when needed.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/pci-host/pnv_phb4.c     | 9 +--------
 hw/pci-host/pnv_phb4_pec.c | 3 ---
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
index c688976caec9..a78add75b043 100644
--- a/hw/pci-host/pnv_phb4.c
+++ b/hw/pci-host/pnv_phb4.c
@@ -672,7 +672,7 @@ static uint64_t pnv_phb4_reg_read(void *opaque, hwaddr off, unsigned size)
 
     switch (off) {
     case PHB_VERSION:
-        return phb->version;
+        return PNV_PHB4_PEC_GET_CLASS(phb->pec)->version;
 
         /* Read-only */
     case PHB_PHB4_GEN_CAP:
@@ -1575,7 +1575,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
     if (!phb->pec) {
         PnvMachineState *pnv = PNV_MACHINE(qdev_get_machine());
         PnvChip *chip = pnv_get_chip(pnv, phb->chip_id);
-        PnvPhb4PecClass *pecc;
         BusState *s;
 
         if (!chip) {
@@ -1589,11 +1588,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
             return;
         }
 
-        /* All other phb properties are already set */
-        pecc = PNV_PHB4_PEC_GET_CLASS(phb->pec);
-        object_property_set_int(OBJECT(phb), "version", pecc->version,
-                                &error_fatal);
-
         /*
          * Reparent user created devices to the chip to build
          * correctly the device tree.
@@ -1688,7 +1682,6 @@ static void pnv_phb4_xive_notify(XiveNotifier *xf, uint32_t srcno)
 static Property pnv_phb4_properties[] = {
         DEFINE_PROP_UINT32("index", PnvPHB4, phb_id, 0),
         DEFINE_PROP_UINT32("chip-id", PnvPHB4, chip_id, 0),
-        DEFINE_PROP_UINT64("version", PnvPHB4, version, 0),
         DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC,
                          PnvPhb4PecState *),
         DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
index a3c4b4ef850c..40d89fda56e5 100644
--- a/hw/pci-host/pnv_phb4_pec.c
+++ b/hw/pci-host/pnv_phb4_pec.c
@@ -117,7 +117,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
                                         Error **errp)
 {
     PnvPHB4 *phb = PNV_PHB4(qdev_new(TYPE_PNV_PHB4));
-    PnvPhb4PecClass *pecc = PNV_PHB4_PEC_GET_CLASS(pec);
     int phb_id = pnv_phb4_pec_get_phb_id(pec, stack_no);
 
     object_property_set_link(OBJECT(phb), "pec", OBJECT(pec),
@@ -126,8 +125,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
                             &error_fatal);
     object_property_set_int(OBJECT(phb), "index", phb_id,
                             &error_fatal);
-    object_property_set_int(OBJECT(phb), "version", pecc->version,
-                            &error_fatal);
 
     if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) {
         return;
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize()
  2022-01-17 12:27 ` [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize() Cédric Le Goater
@ 2022-01-17 19:41   ` Daniel Henrique Barboza
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Henrique Barboza @ 2022-01-17 19:41 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-ppc, qemu-devel



On 1/17/22 09:27, Cédric Le Goater wrote:
> The root port device is currently created and attached to the PHB
> early in pnv_phb4_realize(). Do it under pnv_pec_default_phb_realize()
> after the PHB is fully realized. It's cleaner and avoids an extra
> test on defaults_enabled().
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   hw/pci-host/pnv_phb4.c     | 7 -------
>   hw/pci-host/pnv_phb4_pec.c | 3 +++
>   2 files changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
> index 1db815b1aba0..c688976caec9 100644
> --- a/hw/pci-host/pnv_phb4.c
> +++ b/hw/pci-host/pnv_phb4.c
> @@ -22,7 +22,6 @@
>   #include "hw/irq.h"
>   #include "hw/qdev-properties.h"
>   #include "qom/object.h"
> -#include "sysemu/sysemu.h"
>   #include "trace.h"
>   
>   #define phb_error(phb, fmt, ...)                                        \
> @@ -1639,12 +1638,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>       pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
>       pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
>   
> -    /* Add a single Root port if running with defaults */
> -    if (defaults_enabled()) {
> -        pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb),
> -                                 TYPE_PNV_PHB4_ROOT_PORT);
> -    }
> -
>       /* Setup XIVE Source */
>       if (phb->big_phb) {
>           nr_irqs = PNV_PHB4_MAX_INTs;
> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
> index 12aa4596282b..b19e89236a63 100644
> --- a/hw/pci-host/pnv_phb4_pec.c
> +++ b/hw/pci-host/pnv_phb4_pec.c
> @@ -132,6 +132,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>       if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) {
>           return;
>       }
> +
> +    /* Add a single Root port if running with defaults */
> +    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT);
>   }
>   
>   static void pnv_pec_realize(DeviceState *dev, Error **errp)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC
  2022-01-17 12:27 ` [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC Cédric Le Goater
@ 2022-01-17 19:44   ` Daniel Henrique Barboza
  0 siblings, 0 replies; 9+ messages in thread
From: Daniel Henrique Barboza @ 2022-01-17 19:44 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-ppc, qemu-devel



On 1/17/22 09:27, Cédric Le Goater wrote:
> PHB5 will introduce its own root port model. Prepare ground for it.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   include/hw/pci-host/pnv_phb4.h | 1 +
>   hw/pci-host/pnv_phb4_pec.c     | 5 ++++-
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h
> index 74fdec2b478b..0c7635dec591 100644
> --- a/include/hw/pci-host/pnv_phb4.h
> +++ b/include/hw/pci-host/pnv_phb4.h
> @@ -203,6 +203,7 @@ struct PnvPhb4PecClass {
>       int stk_compat_size;
>       uint64_t version;
>       const uint32_t *num_phbs;
> +    const char *rp_model;
>   };
>   
>   #endif /* PCI_HOST_PNV_PHB4_H */
> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
> index b19e89236a63..a3c4b4ef850c 100644
> --- a/hw/pci-host/pnv_phb4_pec.c
> +++ b/hw/pci-host/pnv_phb4_pec.c
> @@ -134,7 +134,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>       }
>   
>       /* Add a single Root port if running with defaults */
> -    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT);
> +    pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb),
> +                             PNV_PHB4_PEC_GET_CLASS(pec)->rp_model);
> +
>   }
>   
>   static void pnv_pec_realize(DeviceState *dev, Error **errp)
> @@ -267,6 +269,7 @@ static void pnv_pec_class_init(ObjectClass *klass, void *data)
>       pecc->stk_compat_size = sizeof(stk_compat);
>       pecc->version = PNV_PHB4_VERSION;
>       pecc->num_phbs = pnv_pec_num_phbs;
> +    pecc->rp_model = TYPE_PNV_PHB4_ROOT_PORT;
>   }
>   
>   static const TypeInfo pnv_pec_type_info = {


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] ppc/pnv: Remove PHB4 version property
  2022-01-17 12:27 ` [PATCH 3/3] ppc/pnv: Remove PHB4 version property Cédric Le Goater
@ 2022-01-17 19:50   ` Daniel Henrique Barboza
  2022-01-18  6:58     ` Cédric Le Goater
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Henrique Barboza @ 2022-01-17 19:50 UTC (permalink / raw)
  To: Cédric Le Goater, qemu-ppc, qemu-devel



On 1/17/22 09:27, Cédric Le Goater wrote:
> and grab the PHB version from the PEC class directly when needed.

I guess we want a capital "A" when starting the commit msg

> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---


This change also makes pnv-phb4s a little closer with pnv-phb3s, given that we don't
have a "Version" attribute exposed in the QOM for pnv-phb3s as well.


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>

>   hw/pci-host/pnv_phb4.c     | 9 +--------
>   hw/pci-host/pnv_phb4_pec.c | 3 ---
>   2 files changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
> index c688976caec9..a78add75b043 100644
> --- a/hw/pci-host/pnv_phb4.c
> +++ b/hw/pci-host/pnv_phb4.c
> @@ -672,7 +672,7 @@ static uint64_t pnv_phb4_reg_read(void *opaque, hwaddr off, unsigned size)
>   
>       switch (off) {
>       case PHB_VERSION:
> -        return phb->version;
> +        return PNV_PHB4_PEC_GET_CLASS(phb->pec)->version;
>   
>           /* Read-only */
>       case PHB_PHB4_GEN_CAP:
> @@ -1575,7 +1575,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>       if (!phb->pec) {
>           PnvMachineState *pnv = PNV_MACHINE(qdev_get_machine());
>           PnvChip *chip = pnv_get_chip(pnv, phb->chip_id);
> -        PnvPhb4PecClass *pecc;
>           BusState *s;
>   
>           if (!chip) {
> @@ -1589,11 +1588,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>               return;
>           }
>   
> -        /* All other phb properties are already set */
> -        pecc = PNV_PHB4_PEC_GET_CLASS(phb->pec);
> -        object_property_set_int(OBJECT(phb), "version", pecc->version,
> -                                &error_fatal);
> -
>           /*
>            * Reparent user created devices to the chip to build
>            * correctly the device tree.
> @@ -1688,7 +1682,6 @@ static void pnv_phb4_xive_notify(XiveNotifier *xf, uint32_t srcno)
>   static Property pnv_phb4_properties[] = {
>           DEFINE_PROP_UINT32("index", PnvPHB4, phb_id, 0),
>           DEFINE_PROP_UINT32("chip-id", PnvPHB4, chip_id, 0),
> -        DEFINE_PROP_UINT64("version", PnvPHB4, version, 0),
>           DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC,
>                            PnvPhb4PecState *),
>           DEFINE_PROP_END_OF_LIST(),
> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
> index a3c4b4ef850c..40d89fda56e5 100644
> --- a/hw/pci-host/pnv_phb4_pec.c
> +++ b/hw/pci-host/pnv_phb4_pec.c
> @@ -117,7 +117,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>                                           Error **errp)
>   {
>       PnvPHB4 *phb = PNV_PHB4(qdev_new(TYPE_PNV_PHB4));
> -    PnvPhb4PecClass *pecc = PNV_PHB4_PEC_GET_CLASS(pec);
>       int phb_id = pnv_phb4_pec_get_phb_id(pec, stack_no);
>   
>       object_property_set_link(OBJECT(phb), "pec", OBJECT(pec),
> @@ -126,8 +125,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>                               &error_fatal);
>       object_property_set_int(OBJECT(phb), "index", phb_id,
>                               &error_fatal);
> -    object_property_set_int(OBJECT(phb), "version", pecc->version,
> -                            &error_fatal);
>   
>       if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) {
>           return;


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] ppc/pnv: Remove PHB4 version property
  2022-01-17 19:50   ` Daniel Henrique Barboza
@ 2022-01-18  6:58     ` Cédric Le Goater
  0 siblings, 0 replies; 9+ messages in thread
From: Cédric Le Goater @ 2022-01-18  6:58 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-ppc, qemu-devel

On 1/17/22 20:50, Daniel Henrique Barboza wrote:
> 
> 
> On 1/17/22 09:27, Cédric Le Goater wrote:
>> and grab the PHB version from the PEC class directly when needed.
> 
> I guess we want a capital "A" when starting the commit msg

I just removed the 'and'.

Thanks,

C.


> 
>>
>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>> ---
> 
> 
> This change also makes pnv-phb4s a little closer with pnv-phb3s, given that we don't
> have a "Version" attribute exposed in the QOM for pnv-phb3s as well.
> 
> 
> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> 
>>   hw/pci-host/pnv_phb4.c     | 9 +--------
>>   hw/pci-host/pnv_phb4_pec.c | 3 ---
>>   2 files changed, 1 insertion(+), 11 deletions(-)
>>
>> diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c
>> index c688976caec9..a78add75b043 100644
>> --- a/hw/pci-host/pnv_phb4.c
>> +++ b/hw/pci-host/pnv_phb4.c
>> @@ -672,7 +672,7 @@ static uint64_t pnv_phb4_reg_read(void *opaque, hwaddr off, unsigned size)
>>       switch (off) {
>>       case PHB_VERSION:
>> -        return phb->version;
>> +        return PNV_PHB4_PEC_GET_CLASS(phb->pec)->version;
>>           /* Read-only */
>>       case PHB_PHB4_GEN_CAP:
>> @@ -1575,7 +1575,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>>       if (!phb->pec) {
>>           PnvMachineState *pnv = PNV_MACHINE(qdev_get_machine());
>>           PnvChip *chip = pnv_get_chip(pnv, phb->chip_id);
>> -        PnvPhb4PecClass *pecc;
>>           BusState *s;
>>           if (!chip) {
>> @@ -1589,11 +1588,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
>>               return;
>>           }
>> -        /* All other phb properties are already set */
>> -        pecc = PNV_PHB4_PEC_GET_CLASS(phb->pec);
>> -        object_property_set_int(OBJECT(phb), "version", pecc->version,
>> -                                &error_fatal);
>> -
>>           /*
>>            * Reparent user created devices to the chip to build
>>            * correctly the device tree.
>> @@ -1688,7 +1682,6 @@ static void pnv_phb4_xive_notify(XiveNotifier *xf, uint32_t srcno)
>>   static Property pnv_phb4_properties[] = {
>>           DEFINE_PROP_UINT32("index", PnvPHB4, phb_id, 0),
>>           DEFINE_PROP_UINT32("chip-id", PnvPHB4, chip_id, 0),
>> -        DEFINE_PROP_UINT64("version", PnvPHB4, version, 0),
>>           DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC,
>>                            PnvPhb4PecState *),
>>           DEFINE_PROP_END_OF_LIST(),
>> diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c
>> index a3c4b4ef850c..40d89fda56e5 100644
>> --- a/hw/pci-host/pnv_phb4_pec.c
>> +++ b/hw/pci-host/pnv_phb4_pec.c
>> @@ -117,7 +117,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>>                                           Error **errp)
>>   {
>>       PnvPHB4 *phb = PNV_PHB4(qdev_new(TYPE_PNV_PHB4));
>> -    PnvPhb4PecClass *pecc = PNV_PHB4_PEC_GET_CLASS(pec);
>>       int phb_id = pnv_phb4_pec_get_phb_id(pec, stack_no);
>>       object_property_set_link(OBJECT(phb), "pec", OBJECT(pec),
>> @@ -126,8 +125,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState *pec,
>>                               &error_fatal);
>>       object_property_set_int(OBJECT(phb), "index", phb_id,
>>                               &error_fatal);
>> -    object_property_set_int(OBJECT(phb), "version", pecc->version,
>> -                            &error_fatal);
>>       if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) {
>>           return;



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/3] ppc/pnv: Final refinements on PHB4s
  2022-01-17 12:27 [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
                   ` (2 preceding siblings ...)
  2022-01-17 12:27 ` [PATCH 3/3] ppc/pnv: Remove PHB4 version property Cédric Le Goater
@ 2022-01-18 12:01 ` Cédric Le Goater
  3 siblings, 0 replies; 9+ messages in thread
From: Cédric Le Goater @ 2022-01-18 12:01 UTC (permalink / raw)
  To: qemu-ppc, qemu-devel; +Cc: Daniel Henrique Barboza

On 1/17/22 13:27, Cédric Le Goater wrote:
> Hello,
> 
> These are the last little tweaks on PHB4 to prepare ground for PHB5.
> 
> Thanks,
> 
> C.
> 
> Cédric Le Goater (3):
>    ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize()
>    ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC
>    ppc/pnv: Remove PHB4 version property




Applied to ppc-7.0

Thanks,

C.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-01-18 12:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 12:27 [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater
2022-01-17 12:27 ` [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize() Cédric Le Goater
2022-01-17 19:41   ` Daniel Henrique Barboza
2022-01-17 12:27 ` [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC Cédric Le Goater
2022-01-17 19:44   ` Daniel Henrique Barboza
2022-01-17 12:27 ` [PATCH 3/3] ppc/pnv: Remove PHB4 version property Cédric Le Goater
2022-01-17 19:50   ` Daniel Henrique Barboza
2022-01-18  6:58     ` Cédric Le Goater
2022-01-18 12:01 ` [PATCH 0/3] ppc/pnv: Final refinements on PHB4s Cédric Le Goater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.