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

Re: [PATCH] xen/arm: do not try to add pci-domain for disabled devices


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Thu, 28 Oct 2021 18:09:19 +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=tCVOlmoi5k3p/KxFgnd0uAiN1JjQp/1/AWb1Vk1P7/Y=; b=Hy/KeAQCZO6gQa+x7d8UbpN91Kw4UKlIfmvmsWyoPBWRDSTxkWdtr3Q+MbmCi3VOFrq7K48P5mONe3Br/M66BKQLeONrxvWhmiMPCZjc2mY+lCA6/lJ/WYOALxfwOf2zRsPssK9IH8qyuZDsWqRurMCQLLefZXm6MvnVKeQ2o2ZGMzZA+5B0MEmhHv8/wQo6iy1C5X/FeM0xJm0U644Q6vjH+alep3GD6tndS99L7OekoHye1DqdCa4tRpd2H01lcg8/L6EFNRtvHwUa/7W4/NeShJM2dI0AgNkQ+xED45uxasAskr/xsKjDtRukm7xUokk/ZUF04SrO7NOfc+hmJA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y0n9luGLj/ZXa/p3bMPZq0KBxwMRBG5/UzS8yfi0NuTeaLMDEyJ7B01o1bKXQb2kXLish/s/GioLWN2fIov15fTv+KcI8k7GFiGv+GFCxrR+AgqZB+KkOi9Q3iwUiBvO3s7LveNjALHjs8App3dluTEK4i04Ux2z97pTNRNtY3Gmhe+fMHe0B+HHWgDlAQQIZBwkk6+t4N5qafCmjjwEnthy7VYQmhKSPqsZ1+wcjGYEqi1mY9Ot50Z++RXnEjK7z75JLBL2Gyua5mHUFKerOP2Q3QsWNDqO8+mmCmttcu6MGykHB70AucgHbFmjuONqHKqffyhZtIervfTWinKgaA==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "iwj@xxxxxxxxxxxxxx" <iwj@xxxxxxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Thu, 28 Oct 2021 18:09:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXyw3lMiQK+jRYtUWdkzZ53OfPJavnJMeAgABhyQCAALX3gIAAZSoAgAAWCQA=
  • Thread-topic: [PATCH] xen/arm: do not try to add pci-domain for disabled devices


On 28.10.21 19:50, Stefano Stabellini wrote:
> On Thu, 28 Oct 2021, Julien Grall wrote:
>> Hi Stefano,
>>
>> On 28/10/2021 00:57, Stefano Stabellini wrote:
>>> On Wed, 27 Oct 2021, Julien Grall wrote:
>>>> Hi Oleksandr,
>>>>
>>>> On 27/10/2021 09:37, Oleksandr Andrushchenko wrote:
>>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>>>>
>>>>> If a PCI host bridge device is present in the device tree, but is
>>>>> disabled, then its PCI host bridge driver was not instantiated.
>>>>> This results in the following panic during Xen start:
>>>>>
>>>>> (XEN) Device tree generation failed (-22).
>>>> It would good to clarify in the commit message where the error is coming
>>>> from.
>>>> I think this is from pci_get_host_bridge_segment().
>>>>
>>>>> (XEN)
>>>>> (XEN) ****************************************
>>>>> (XEN) Panic on CPU 0:
>>>>> (XEN) Could not set up DOM0 guest OS
>>>>> (XEN) ****************************************
>>>>>
>>>>> Fix this by not adding linux,pci-domain property for hwdom if it is
>>>>> neither available nor device enabled.
>>>>   From my reading of the binding [1], the property should be present in all
>>>> the
>>>> hostbridges if one specify it. IOW, I think the property should also be
>>>> added
>>>> for hostbridges that are not available.
>>> Just wanted to say that I think you are right:
>>>
>>> """
>>> It is required to either not set this property at all or set it for all
>>> host bridges in the system, otherwise potentially conflicting domain numbers
>>> may be assigned to root buses behind different host bridges.  The domain
>>> number for each host bridge in the system must be unique.
>>> """
>>>
>>> and I am ready to believe device trees with disabled bridges might have
>>> (incorrectly) ignored the rule.
>> Looking at linux/arch/arm64/boot/dts/, there are a few Device-Tree that
>> contain the property "linux,pci-domain". All of them seems to also add it for
>> disabled hostbridges.
>>
>> However, I am under the impression that it is more common to have a
>> Devide-Tree without any property "linux,pci-domain". When PCI support is
>> enabled, Xen will generate the domain ID for the hostbridge and write it to
>> the DT.
>>
>> This doesn't work for disabled hostbridge and I think this is Oleksandr's
>> problem. @Oleksandr can you confirm it?
>>
>>>
>>>> AFAICT, Linux will ignore hostbridge that are not available. But it feels
>>>> to
>>>> me we are twisting the rule. So, could we consider to allocate an unused
>>>> number?
>>> I think that would be fine but it doesn't look easy from the current Xen
>>> code point of view because the allocation depends on the Xen driver,
>>> which we don't have. But I'll let others comment on it.
>> So what matters is Xen doesn't make things worse. We have two cases to care:
>>    1) Xen only has drivers for a part of the hostbriges
>>    2) Some hostbriges are disabled
>>
>> Case 1) will definitely generate a DT that will make Linux unhappy if we have
>> don't add the property consistently.
> Good point!
So, the bottom line: we add the property regardless of the status?
And the segment we assign for the disabled ones is pci_get_new_domain_nr()?
I guess nothing bad happens if we have say 3 bridges:
okay - > seg 0
disabled - > seg 1
okay - > seg 2

 


Rackspace

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