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

Re: [PATCH v1 14/14] xen/arm: Add linux,pci-domain property for hwdom if not available.


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Thu, 16 Sep 2021 16:36:18 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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; bh=Rh5U5jBs7lh719Lm+U+c+VrgWPm2L8w30+OVH8bS7NQ=; b=MxEGdEqz8MTu1CA4iT3hYxLjUszzXlwvPgEJbGovA+ln67po4jg5VdMdSFUqeroZf4tajKv29J+WVjPJCNICCUCgHmCgtAi/f04sxR1TG/a3sTULa4MnXsRWeDXHPRSOG/H6REIGzFa24C9yHK7QblftqXlHYq7tr+idEDAXYqfbWr3wr16q19wC0zZFVAQKA6Tfmyvxt/zhlKDr4aTnnQpzs2v65/KSsqpEO9WLS+YxjK9kyG+UTdyx0WoKD6lZthJFBzguEI/4+ZzlaZlGaIIC2QvT31Mm49eP9PvZW7GFvc9lzhdMZxy/vkl2HJkh/ZAprL+m4jFSQUChU5AODA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qq8u6PTZUrKX4I3c0QI0owmnhAXTNg//YP4fGSuFkoOGVZd70Hui7cJAW1AQ3gB6NHF7bNM+sXLihpm42eU6jjiMu9HtXLtEwW3/pQumy8n30J/FcQOAE0Tbkhz6Ag4clBnj7EKVKYX2qG+JEB7V+gYFUiYRrcGO5wkYSHgtL/CdNgGz31akOmXruQ0xl8lyv9eamwRj5gqVIIMdmpgmTTUtcVwhkuG+/bDnOhEdd89xlTzUqeBHd18LRY6xpQuRiDzrEESUXracRv/c4Nul2rErfddO9guy8y1Qfaf0yUxs3gjZ5icboC2DUz9lXe4SxoxHELXidPmgJXBK4ukInw==
  • Authentication-results-original: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 16 Sep 2021 16:36:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXlPMDjN8YIk1EsES2o1HUm/aDequclJ+AgApzbQA=
  • Thread-topic: [PATCH v1 14/14] xen/arm: Add linux,pci-domain property for hwdom if not available.

Hi Stefano,

> On 10 Sep 2021, at 2:00 am, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> On Thu, 19 Aug 2021, Rahul Singh wrote:
>> If the property is not present in the device tree node for host bridge,
>> XEN while creating the dtb for hwdom will create this property and
>> assigns the already allocated segment to the host bridge
>> so that XEN and linux will have the same segment for the host bridges.
>> 
>> Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>
>> ---
>> xen/arch/arm/domain_build.c        | 18 ++++++++++++++++++
>> xen/arch/arm/pci/pci-host-common.c | 21 +++++++++++++++++++++
>> xen/include/asm-arm/pci.h          |  3 +++
>> 3 files changed, 42 insertions(+)
>> 
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 6c86d52781..e0cf2ff19d 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -581,6 +581,24 @@ static int __init write_properties(struct domain *d, 
>> struct kernel_info *kinfo,
>>             return res;
>>     }
>> 
>> +#ifdef CONFIG_HAS_PCI
>> +    if ( dt_device_type_is_equal(node, "pci") )
>> +    {
>> +        if ( !dt_find_property(node, "linux,pci-domain", NULL) )
>> +        {
>> +            uint16_t segment;
>> +
>> +            res = pci_get_host_bridge_segment(node, &segment);
>> +            if ( res < 0 )
>> +                return res;
>> +
>> +            res = fdt_property_cell(kinfo->fdt, "linux,pci-domain", 
>> segment);
>> +            if ( res )
>> +                return res;
>> +        }
>> +    }
>> +#endif
> 
> If param_pci_enable is false it might be possible that Xen didn't
> allocate a segment. In that case, we should just let Linux do whatever
> it wants in terms of segment allocation. So I think the code here should
> not return error if param_pci_enable is false.
> returning an error instead.

Ack. I will modify the code as per your request in next version.

Regards,
Rahul




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.