[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 2/7] xen/arm: add pci-domain for disabled devices
- To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Julien Grall <julien@xxxxxxx>
- Date: Tue, 23 Nov 2021 16:05:05 +0000
- Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <Oleksandr_Tyshchenko@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, "andrew.cooper3@xxxxxxxxxx" <andrew.cooper3@xxxxxxxxxx>, "george.dunlap@xxxxxxxxxx" <george.dunlap@xxxxxxxxxx>, "paul@xxxxxxx" <paul@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>
- Delivery-date: Tue, 23 Nov 2021 16:05:31 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Hi Oleksandr,
On 23/11/2021 06:31, Oleksandr Andrushchenko wrote:
On 22.11.21 19:17, Julien Grall wrote:
Hi,
On 22/11/2021 16:23, Oleksandr Andrushchenko wrote:
On 22.11.21 17:29, Julien Grall wrote:
I would prefer to go with my way. This can be refined in the future if we find
Device-Tree that matches what you wrote.
Ok, so just to make it clear:
>a PCI device would always be described as a child of the hostbridges. So I would rework the 'if' to also check
if the parent type is not "pci"
That's correct. Thank you!
Ok, so how about
if ( is_pci_passthrough_enabled() && dt_device_type_is_equal(node, "pci")
)
{
bool skip = false;
/*
* If the parent is also a "pci" device, then "linux,pci-domain"
* should already be there, so nothing to do then.
*/
This comment is a bit confusing. I think what matter if the parent is a
"pci" device, then the current node must not be a hostbridge. So we can
skip it. However...
if ( node->parent && dt_device_type_is_equal(node->parent, "pci") )
skip = true;
if ( !skip && !dt_find_property(node, "linux,pci-domain", NULL) )
{
I played with a single if and it looks scary...
... how about introducing an helper that will return true if this node
is likely an hostbridge?
Cheers,
--
Julien Grall
|