[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: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Date: Tue, 23 Nov 2021 16:44:32 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q+/gV1yzbKWHlXm9d6UM4DKOw3Z7lrkKkJYWhzrEFmA=; b=DhMY9QX7DJNAf+M8hS0H4ZXCTUi7SjLBgxN6/yUZK8C8WMs6nLwDZTkOk2fwlzNMUDZOh27I700aoD+/KOFEb2J09Hh76H+OqZ7fq8Mc/KDcdRkPZsmltru4Ok9jv+FxTq8NGyulnj+ulZKXriimcuYW1/nn8P90eOb4UMq5lOXX7KyGNIAB2MIyhTff4ulBTy6TYLPwswSPOmfrYVrvymo7l/jrhHMboeh5BXRiGHHitqXpugp/h0LPBcNl8voy1Fq9JzG0JiRLJ2gaCoPDiaakjoWisI9JaR82ExPzD5vAqO+CPMEbGBH8dGN1/DGLtCyiyjdULR0CYYmTXMqNaA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EShTJGM7q7Y8ZWXq3bwiTO8JxQz3l/AYLEF1CiPu5R7B7xeNRv7iOqD1lGVjfAytCDM6rdJ9RrBlcaqAh7j7X7Qy1JoSR2qne4uKpDMIhrec17RzZetr4DJIKMeNx6Q5N3laxzbHKsnHt7zSChdj4OilScPnplHbq0sFcNHokd0r/lKWaZ5IjjrkhqyqgyxLKp9xca5nFuiYlaxZnU5yWkG9MvBA33/rhnR4S5Ix5rLpxYpHWe+rPnDibkJR1nsBwCFibz9vF95B2Be5FiqsYTk+oiAm3ToZYs31sO6o6ZqvVB9lznuT1H+XlFYaF3ux5u8O3EiRAsxMps28TSR50g==
- 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>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
- Delivery-date: Tue, 23 Nov 2021 16:44:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHX0g8QVTbfP59mVU+LM2unTUGOtawGkRQAgADLYgCAAPUEgIAAofWAgAbUDQCAAA7WAIAADxaAgADd7ICAAKBPgIAACwWA
- Thread-topic: [PATCH v6 2/7] xen/arm: add pci-domain for disabled devices
Hi, Julien!
On 23.11.21 18:05, Julien Grall wrote:
> 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.
Do you have something on your mind?
> 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.
By skipping you only mean we do not need to add/assign "linux,pci-domain",
right?
> 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?
This is yet a single use of such a check: why would we need a helper and what
would that
helper do?
>
> Cheers,
>
Thank you,
Oleksandr
|