qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.ibm.com>
To: clg@kaod.org, danielhb413@gmail.com, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org
Subject: [PATCH 2/3] ppc/pnv: Fixes for user-created pnv-phb5 devices
Date: Thu, 10 Mar 2022 16:51:00 +0100	[thread overview]
Message-ID: <20220310155101.294568-3-fbarrat@linux.ibm.com> (raw)
In-Reply-To: <20220310155101.294568-1-fbarrat@linux.ibm.com>

Two small fixes to fix user-created devices for POWER10:
- always create the PECs (PCI Express Controller) for the system. The
PECs host the PHBs and we try to find the matching PEC when creating a
PHB, so it must exist. It also matches what we do on POWER9
- the machine class must allow dynamically allocated system bus

Fixes: 623575e16cd5 ("ppc/pnv: Add model for POWER10 PHB5 PCIe Host bridge")
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
---
 hw/ppc/pnv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 0ac86e104f..df58403a3a 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1600,9 +1600,7 @@ static void pnv_chip_power10_instance_init(Object *obj)
     object_initialize_child(obj, "occ",  &chip10->occ, TYPE_PNV10_OCC);
     object_initialize_child(obj, "homer", &chip10->homer, TYPE_PNV10_HOMER);
 
-    if (defaults_enabled()) {
-        chip->num_pecs = pcc->num_pecs;
-    }
+    chip->num_pecs = pcc->num_pecs;
 
     for (i = 0; i < chip->num_pecs; i++) {
         object_initialize_child(obj, "pec[*]", &chip10->pecs[i],
@@ -2171,6 +2169,8 @@ static void pnv_machine_power10_class_init(ObjectClass *oc, void *data)
     pmc->dt_power_mgt = pnv_dt_power_mgt;
 
     xfc->match_nvt = pnv10_xive_match_nvt;
+
+    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_PNV_PHB5);
 }
 
 static bool pnv_machine_get_hb(Object *obj, Error **errp)
-- 
2.35.1



  parent reply	other threads:[~2022-03-10 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 15:50 [PATCH 0/3] Fix user-created PHB devices on POWER10 Frederic Barrat
2022-03-10 15:50 ` [PATCH 1/3] ppc/pnv: Introduce a pnv-phb5 device to match root port Frederic Barrat
2022-03-10 16:16   ` Cédric Le Goater
2022-03-10 15:51 ` Frederic Barrat [this message]
2022-03-10 16:16   ` [PATCH 2/3] ppc/pnv: Fixes for user-created pnv-phb5 devices Cédric Le Goater
2022-03-10 15:51 ` [PATCH 3/3] ppc/pnv: Fix PEC lookup function for POWER10 Frederic Barrat
2022-03-10 16:17   ` Cédric Le Goater
2022-03-14 15:21 ` [PATCH 0/3] Fix user-created PHB devices on POWER10 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=20220310155101.294568-3-fbarrat@linux.ibm.com \
    --to=fbarrat@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --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).