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

Re: [PATCH v1 5/8] xen/pci: introduce has_vpci_bridge


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Thu, 13 Nov 2025 09:49:01 +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=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=ocok5+6KyO2CnExoU/r9C98Mtul8NiQfKINon8RrYPk=; b=fnJv8BpAW6cZi8siTywnyxfFF6R1LDUtpUGXsvZK9SrW89U8qcC3aygRUW6ySLDx/+a10bRulf/Iyn/i/H+5PNgMFXyI572BPz1t/EQtfFx0rlxR+zdVD10PAvKs5KIFbbnq6fzUiKcINLAqhLBCExYNj1FTBMxg6xm0gi2EFBHs38wlnWNt67tV6ofWGzIHkkO7WJAys3PXZki+xxEyHuENhO1KPOq6VqB1wtdeI2ovz/P7qAPstol4yqIB1FdzHGlua/WKVbhRmaT1Bnrbp08U6Px0O42m1uWsJXkaivfl39InfyrFoT+iOG+l3CWLtfww47f85i3Pddk8GyqZCg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NIG7sT0rvFh7m+1N6DRDwu3VfHezgQPZBaYS2Xo1q82PWKQtMdY59+QBWGmzcRKOsF835Sw/KQa7sfjYEJw7HW9v0rLh/0lv4FhFOeEk46QOwAZlv7HGCiyF9MnMtS88z7L5eUA779d9bR+AzJv62klN9jitok66hs0eyvJtz0fDBw/cnPGlwPlI+u+B/AFPmXNvuohsJowyRxwm6PjT7sl6fQUVoO+KRmCLaOoT0+9Vq3s29OH+DotL5kqeqYmJANvPPrcqnUNP1g8taf0RtmWnh20pS7KN8WgTIMzlcRfjyy0NvmJiRaYhYXnOoMQuP3Tt/1zQy6X1XGtIPO4wag==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <stefano.stabellini@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 13 Nov 2025 09:49:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcLSkjUCcQVsMHP0qfA2BNpZwKybTl064AgArXagA=
  • Thread-topic: [PATCH v1 5/8] xen/pci: introduce has_vpci_bridge

On 06.11.25 14:15, Jan Beulich wrote:> On 24.09.2025 09:59, Mykyta 
Poturai wrote:
 >> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
 >>
 >> has_vpci_bridge is a macro to check if the domain is a domU or is dom0
 >> with vPCI (pci-scan=yes) enabled.
 >
 > Hmm. Why would DomU-s, now and forever, not have (virtual) bridges? 
Wasn't them
 > gaining (virtual) bridges actually the longer-term plan?
 >

Seems like there is a misunderstanding here. Indeed it is the plan for 
DomUs to have virtual bridges and this check is designed to 
differentiate two categories of domains.
1. All DomUs + Dom0 with the virtual bridge.
2. Dom0 with HW bridge.

I will try to rephrase the commit message to be more clear.

 >> @@ -866,7 +866,7 @@ int vpci_init_header(struct pci_dev *pdev)
 >>       struct vpci_header *header = &pdev->vpci->header;
 >>       struct vpci_bar *bars = header->bars;
 >>       int rc;
 >> -    bool is_hwdom = is_hardware_domain(pdev->domain);
 >> +    bool is_hwdom = !has_vpci_bridge(pdev->domain);
 >>
 >>       ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
 >
 > For none of the changes (also further ones) it is clear (to me) why the
 > substitution is (logically) correct. For this last instance the variable
 > name also ends up wrong after the replacement.
 >> Jan

The general logic for this change is that before it we assumed that 
hwdom always uses HW bridge. Now it is not always true and hwdom can 
also use a virtual bridge, so it needs to be treated the same way as 
DomUs are.

You also mentioned on a previous series

 > Here and perhaps everywhere else I wonder: Is this really an 
appropriately
 > named predicate for the purpose / context?

Maybe you have some ideas of a better name? From what I came up with 
this seems like the best one.

-- 
Mykyta

 


Rackspace

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