From: Frederic Barrat <fbarrat@linux.ibm.com>
To: "Cédric Le Goater" <clg@kaod.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>,
Greg Kurz <groug@kaod.org>
Subject: Re: [PATCH 07/14] ppc/pnv: Introduce a num_pecs class attribute for PHB4 PEC devices
Date: Tue, 7 Dec 2021 15:03:42 +0100 [thread overview]
Message-ID: <6ee71d8d-33b8-47cf-66c1-92b960d3c5fe@linux.ibm.com> (raw)
In-Reply-To: <fe4c3744-91b1-bd5b-2a04-e2782c46fc09@kaod.org>
On 07/12/2021 11:45, Cédric Le Goater wrote:
> On 12/7/21 11:00, Frederic Barrat wrote:
>>
>>
>> On 02/12/2021 15:42, Cédric Le Goater wrote:
>>> POWER9 processor comes with 3 PHB4 PECs (PCI Express Controller) and
>>> each PEC can have several PHBs :
>>>
>>> * PEC0 provides 1 PHB (PHB0)
>>> * PEC1 provides 2 PHBs (PHB1 and PHB2)
>>> * PEC2 provides 3 PHBs (PHB3, PHB4 and PHB5)
>>>
>>> A num_pecs class attribute represents better the logic units of the
>>> POWER9 chip. Use that instead of num_phbs which fits POWER8 chips.
>>> This will ease adding support for user created devices.
>>>
>>> Signed-off-by: Cédric Le Goater <clg@kaod.org>
>>> ---
>>
>> With this patch, chip->num_phbs is only defined and used on P8. We may
>> want to add a comment to make it clear.
>
> Yes.
>
> With the latest changes, I think we can now move num_phbs under PnvChip8
> and num_pecs under PnvChip9 since they are only used in these routines :
>
> P8:
> static void pnv_chip_power8_instance_init(Object *obj)
> chip->num_phbs = pcc->num_phbs;
> for (i = 0; i < chip->num_phbs; i++) {
>
> static void pnv_chip_power8_realize(DeviceState *dev, Error **errp)
> for (i = 0; i < chip->num_phbs; i++) {
> P9:
> static void pnv_chip_power9_instance_init(Object *obj)
> chip->num_pecs = pcc->num_pecs;
> for (i = 0; i < chip->num_pecs; i++) {
>
> static void pnv_chip_power9_phb_realize(PnvChip *chip, Error **errp)
> for (i = 0; i < chip->num_pecs; i++) {
>
>> As I review this series, something is bugging me though: the
>> difference of handling between P8 and P9.
>> On P9, we seem to have a more logical hiearachy:
>> phb <- PCI controller (PEC) <- chip
>
> Yes. It's cleaner than P8 in terms of logic. P8 initial support was
> done hastily for skiboot bringup in 2014.
>
>> With P8, we don't have an explicit PEC, but we have a PBCQ object,
>> which is somewhat similar. The hierarchy seems also more convoluted.
>
> But we don't have stacks on P8. Do we ?
Stacks were introduced on P9 because all the lanes handled by a PEC
could be grouped differently, each group being called a stack. And each
stack is associated to a PHB.
On P8, there's no such split, so the doc didn't mention stacks. But each
PEC handles exactly one PHB. So we could still keep the same abstractions.
On all chips, a PEC would really be equal to a pbcq interface to the
power bus. The pbcq is servicing one (on P8) or more (on P9/P10) PHBs.
>> I don't see why it's treated differently. It seems both chips could be
>> treated the same, which would make the code easier to follow.
>
> I agree. Daniel certainly would also :)
>
>> That's outside of the scope of this series though.
>
> Well, this patchset enables libvirt support for the PowerNV machines.
> Once this is pushed, we need to keep the API, the object model names
> being part of it.
>
> 7.0 is a good time for a change, really. After that, we won't be able
> to change the QOM hierarchy that much.
>
>> So maybe for a future patch? Who knows, I might volunteer...
>
> You would introduce a phb3-pec on top of the phb3s ?
Or rename pnv_phb3_pbcq.c to pnv_phb3_pec.c and starts from there.
Conceptually, the TYPE_PNV_PBCQ and TYPE_PNV_PHB4_PEC_STACK objects seem
close. But that's easy to say in an email...
Fred
> Let me send a v2 first and may be we could rework the object hierarchy
> in the 7.0 time frame. We don't have to merge this ASAP.
>
> Thanks,
>
> C.
next prev parent reply other threads:[~2021-12-07 14:06 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 14:42 [PATCH 00/14] ppc/pnv: Add support for user created PHB3/PHB4 devices Cédric Le Goater
2021-12-02 14:42 ` [PATCH 01/14] ppc/pnv: Reduce the maximum of PHB3 devices Cédric Le Goater
2021-12-02 17:27 ` Daniel Henrique Barboza
2021-12-02 17:34 ` Cédric Le Goater
2021-12-07 9:40 ` Frederic Barrat
2021-12-07 10:10 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 02/14] ppc/pnv: Drop the "num-phbs" property Cédric Le Goater
2021-12-02 17:27 ` Daniel Henrique Barboza
2021-12-07 9:41 ` Frederic Barrat
2021-12-02 14:42 ` [PATCH 03/14] ppc/pnv: Move mapping of the PHB3 CQ regions under pnv_pbcq_realize() Cédric Le Goater
2021-12-02 17:29 ` Daniel Henrique Barboza
2021-12-07 9:41 ` Frederic Barrat
2021-12-02 14:42 ` [PATCH 04/14] ppc/pnv: Introduce support for user created PHB3 devices Cédric Le Goater
2021-12-02 17:31 ` Daniel Henrique Barboza
2021-12-07 9:47 ` Frederic Barrat
2021-12-07 10:17 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 05/14] ppc/pnv: Reparent user created PHB3 devices to the PnvChip Cédric Le Goater
2021-12-02 17:32 ` Daniel Henrique Barboza
2021-12-07 9:51 ` Frederic Barrat
2021-12-02 14:42 ` [PATCH 06/14] ppc/pnv: Complete user created PHB3 devices Cédric Le Goater
2021-12-02 17:33 ` Daniel Henrique Barboza
2021-12-07 9:53 ` Frederic Barrat
2021-12-07 10:19 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 07/14] ppc/pnv: Introduce a num_pecs class attribute for PHB4 PEC devices Cédric Le Goater
2021-12-02 17:34 ` Daniel Henrique Barboza
2021-12-07 10:00 ` Frederic Barrat
2021-12-07 10:45 ` Cédric Le Goater
2021-12-07 14:03 ` Frederic Barrat [this message]
2021-12-07 14:34 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 08/14] ppc/pnv: Introduce version and device_id class atributes for PHB4 devices Cédric Le Goater
2021-12-02 17:37 ` Daniel Henrique Barboza
2021-12-07 10:01 ` Frederic Barrat
2021-12-07 10:21 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 09/14] ppc/pnv: Introduce a "chip" property under the PHB4 model Cédric Le Goater
2021-12-02 17:37 ` Daniel Henrique Barboza
2021-12-07 10:01 ` Frederic Barrat
2021-12-02 14:42 ` [PATCH 10/14] ppc/pnv: Introduce a num_stack class attribute Cédric Le Goater
2021-12-02 17:44 ` Daniel Henrique Barboza
2021-12-07 10:04 ` Frederic Barrat
2021-12-02 14:42 ` [PATCH 11/14] ppc/pnv: Compute the PHB index from the PHB4 PEC model Cédric Le Goater
2021-12-02 17:47 ` Daniel Henrique Barboza
2021-12-07 10:06 ` Frederic Barrat
2021-12-07 10:24 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 12/14] ppc/pnv: Remove "system-memory" property for he " Cédric Le Goater
2021-12-02 17:47 ` Daniel Henrique Barboza
2021-12-07 10:08 ` Frederic Barrat
2021-12-07 10:29 ` Cédric Le Goater
2021-12-07 10:11 ` Frederic Barrat
2021-12-02 14:42 ` [PATCH 13/14] ppc/pnv: Move realize of PEC stacks under the " Cédric Le Goater
2021-12-02 17:49 ` Daniel Henrique Barboza
2021-12-07 10:10 ` Frederic Barrat
2021-12-07 10:30 ` Cédric Le Goater
2021-12-02 14:42 ` [PATCH 14/14] ppc/pnv: Introduce support for user created PHB4 devices Cédric Le Goater
2021-12-02 17:49 ` Daniel Henrique Barboza
2021-12-07 10:12 ` Frederic Barrat
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=6ee71d8d-33b8-47cf-66c1-92b960d3c5fe@linux.ibm.com \
--to=fbarrat@linux.ibm.com \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.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).