qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 4/5] ppc/pnv: Introduce user creatable pnv-phb4 devices


From: Cédric Le Goater
Subject: Re: [PATCH v5 4/5] ppc/pnv: Introduce user creatable pnv-phb4 devices
Date: Tue, 11 Jan 2022 16:47:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 1/11/22 15:57, Daniel Henrique Barboza wrote:


On 1/11/22 11:42, Cédric Le Goater wrote:
On 1/11/22 14:10, Daniel Henrique Barboza wrote:
This patch introduces pnv-phb4 user creatable devices that are created
in a similar manner as pnv-phb3 devices, allowing the user to interact
with the PHBs directly instead of creating PCI Express Controllers that
will create a certain amount of PHBs per controller index.

We accomplish this by doing the following:

- add a pnv_phb4_get_stack() helper to retrieve which stack an user
created phb4 would occupy;

- when dealing with an user created pnv-phb4 (detected by checking if
phb->stack is NULL at the start of phb4_realize()), retrieve its stack
and initialize its properties as done in stk_realize();

- use 'defaults_enabled()' in stk_realize() to avoid creating and
initializing a 'stack->phb' qdev that might be overwritten by an user
created pnv-phb4 device. This process is wrapped into a new helper
called pnv_pec_stk_default_phb_realize().

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

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

Nothing is left in the stack model. I think the next cleanup is to
get rid of it.


The first step would be to move some MemoryOps from the stack to the phb, then
little by little we can get into a point where the stack will just be a pointer
to its phb.

This is something that we can keep working on in smaller bits here and there.
I mean, assuming that we're not going to use this code base for PHB5. If that's
the case then I can prioritize this cleanup.

PHB5 uses the same models. Only the PHB version and the root port
model need some adaptation.


On branch https://github.com/legoater/qemu/commits/powernv-7.0,
I have merged :

  ppc/pnv: Move root port allocation under pnv_pec_stk_default_phb_realize()
  ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC
  ppc/pnv: Remove PHB4 version property

preparing ground for :

  ppc/pnv: Add model for POWER10 PHB5 PCIe Host bridge

Should we rework slightly your patchset to include them ? Or we don't
care may be. Please advise :)

Thanks,

C.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]