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

Re: [PATCH v4 5/5] vPCI: re-init extended-capabilities when MMCFG availability changed


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 20 Feb 2026 10:08:50 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=7ch5n7Tuk19BZzjNzkW+Ns5IUSueuFlMnY63JCf9zJk=; b=ORcNS4K5/Kqez5HsUtrMFa4/8fzwBYrQoHQl+0WCr+8QsXEezlf9qw8SUfwqEnPMJ9c0li5vPiYHOAwtf1Ddb2n6X24tiwJ/MqS5wxQJTsOcKXFO3XklYsEUJgp5cDB9aclL5+7ScJLwnWajvveNVlEzYDAde14KuBJLtjMchkxZ2KeWU+3Y4eOVnZbhdj04gItx/FDydcXqEpHkCd8jayPUZ7m0xQbQXhEC43NsQrwq0YPL2hsysUWLDWEQl3iGWg3B9iL6G39pT+ns4JkuVRpdIoISO1kaFEo5QgrRVaBWQV5vMxa9JjkGMKSN2tFxIQ3hjIiOOPcRnYJ3/o9+zA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zSHDeQBA++Op7otgKBB6Y1OVXtnJM+DXVyIe4LWOD0CZB7o+vEzQMx1xcMBHoWkR2Znr97Rv7a/L2xZwSRAl/MvU//nQ5iTDT1W+wJwgamZqBbkiSHpocraotKYozmm9eNKgMCiTTxjxzcbd9aEAYB33BFEuhAtiCNdXP0CN+WB9idIwkEH/v/dy6T6rOxmtjlvF/tL0jJZFm6UBdIQfH8SpKQi+mVsJiITPTrHL6ZUdtxGx1TTTO4CHZ7xwumZwHE11Ia8LA9zEE+44W7ONOiM7FNHyYEseGnfblx+zY6zD3gZ4G75Lh9pd06nMXvfFDwlS+MWg1UGczWOT/p5qPA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 20 Feb 2026 09:09:03 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Feb 20, 2026 at 08:13:58AM +0100, Jan Beulich wrote:
> On 19.02.2026 23:21, Stewart Hildebrand wrote:
> > On 2/10/26 05:55, Jan Beulich wrote:
> >> --- a/xen/drivers/vpci/cap.c
> >> +++ b/xen/drivers/vpci/cap.c
> >> @@ -376,6 +379,20 @@ void vpci_cleanup_capabilities(struct pc
> >>      }
> >>  }
> >>  
> >> +int vpci_reinit_ext_capabilities(struct pci_dev *pdev)
> >> +{
> >> +    if ( !pdev->vpci )
> >> +        return 0;
> >> +
> >> +    vpci_cleanup_capabilities(pdev, true);
> > In the case where pdev->ext_cfg transitions from true to false, it doesn't 
> > look
> > like this would actually result in the respective capability->cleanup() hook
> > being called, due to reliance on pci_find_ext_capability().
> 
> Hmm, indeed. Yet that's a problem with vpci_cleanup_capabilities(), not
> with the call here. It may have been merely latent until no later than
> b1543cf5751b ("PCI: don't look for ext-caps when there's no extended cfg
> space"). The cleanup hooks themselves (it's only one right now) then
> also may not access their respective capabilities anymore (nor even just
> try to locate them).

Cleanup hooks should be idempotent, so in principle there should be no
need to check whether the capability is present before attempting to
clean it up.  However cleanup_rebar() does check for the position of
the capability, and the MMCFG having disappeared would prevent
cleanup there.  At least that capability needs to be adjusted to cache
the position in the config space and the number of BARs, so that the
cleanup hook doesn't rely on PCI config space accesses to fetch any of
this.

Thanks, Roger.



 


Rackspace

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