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

Re: [PATCH] PCI: drop pci_segments_init()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Thu, 27 Feb 2025 12:29:29 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=+49RT3K2F3zmhcQyc6kVZHasUgLxrl07CE8XASnC7BY=; b=xa9AweNEwg1PoqZljNgYzvzsh69+PfEgYzV2t2OzFk8svhRZxwtiwbhz374KcPLq9qiIqzOwvX9CGtOvfAQSw9c+1Cq7vJWtrOQqgFk5mxs/gxB+09A23Ee5qu11MDNWOTQrQhhLGhka/RfSWo5FmG8S+a9ATTLkgYkq3ZEo1T2pkUt2xCDMDhLyrVIlr13hpMcOWFDIONwgfAPxB1oK10mW6sDtQ8YVXn/cG7SUM6DthN/2GR+hEWzwYLs0EDMqokQqmxGPXPyOQDJd+FlbtXlAw7GMjC2l1QzQNRsL2wVJ7ah6VrJzXQusbZ0v1KtFLKtvLW3xP3GNS0rhX9fTdA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sqfjNeEZDqTkumi2gDv+ItGUheQObcK/DZ3yaGdsrFY5gYJec+jk5oEWd17Y+nsDSmk4YVCL8SkTOdk5y/eGfR/UaUSxI7VUsiNttquFYICXE0jdQKBN3A0iBq3kDmM+pA7XGYsWOcjSsQIslaly3I5w3IeSk2vJhl1Fmw3HP8wHvjN5mL5glqkDGtFiczp2k2ebqGY0lTi7Cu04nGAGqEgAQBv5TVfm/P4kn05OGiihuRjXgWJi3Gj3sMW39zcOH2CVS1uDhdNVTOaZ73Z4RzhHa38TewIqkOdIryoo3uiVpTQybyZJmtiZ2h1liThApUjbxF5s2dutPp/LbHeBzw==
  • Cc: Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony Perard <anthony@xxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 27 Feb 2025 17:30:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2/27/25 01:58, Jan Beulich wrote:
> On 26.02.2025 20:57, Stewart Hildebrand wrote:
>> On 2/26/25 06:38, Jan Beulich wrote:
>>> Have callers invoke pci_add_segment() directly instead: With radix tree
>>> initialization moved out of the function, its name isn't quite
>>> describing anymore what it actually does.
>>>
>>> On x86 move the logic into __start_xen() itself, to reduce the risk of
>>> re-introducing ordering issues like the one which was addressed by
>>> 26fe09e34566 ("radix-tree: introduce RADIX_TREE{,_INIT}()").
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> ---
>>> This is entirely optional and up for discussion. There certainly also is
>>> an argument towards keeping the function. Otoh on Arm there is the still
>>> open question whether segment 0 really is kind of special there (as it
>>> is on x86, largely for historical reasons), or whether the code can be
>>> dropped there altogether.
>>
>> Segment 0 is not special on Arm as far as I'm aware. You can have a
>> perfectly functioning system with only, say, segment 1, for example:
>>
>> (XEN) ==== PCI devices ====
>> (XEN) ==== segment 0001 ====
>> (XEN) 0001:00:01.0 - d0 - node -1
>> (XEN) 0001:00:00.0 - d0 - node -1
>>
>> Segment numbers can be arbitrarily chosen by specifying the
>> linux,pci-domain device tree property.
> 
> Right, that was the vague understanding I had.
> 
>>> --- a/xen/arch/arm/pci/pci.c
>>> +++ b/xen/arch/arm/pci/pci.c
>>> @@ -88,7 +88,8 @@ static int __init pci_init(void)
>>>      if ( !pci_passthrough_enabled )
>>>          return 0;
>>>  
>>> -    pci_segments_init();
>>> +    if ( pci_add_segment(0) )
>>> +        panic("Could not initialize PCI segment 0\n");
>>
>> IMO it's okay to remove the call here since there is already a call to
>> pci_add_segment() in
>> xen/arch/arm/pci/pci-host-common.c:pci_host_common_probe()
> 
> Is there? I can't see one, so maybe you're working from a tree with extra
> patches applied?

Ah, you're right, sorry, I was looking at a downstream tree. The
associated segment would be added in Xen upon the first time Dom0 calls
PHYSDEVOP_pci_device_add.



 


Rackspace

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