From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stewart Hildebrand <stewart.hildebrand@amd.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v4 5/5] vPCI: re-init extended-capabilities when MMCFG availability changed
Date: Fri, 20 Feb 2026 10:08:50 +0100 [thread overview]
Message-ID: <aZgkouZccz3aUTeW@macbook.local> (raw)
In-Reply-To: <d082d619-8675-4ae4-bd25-f7f99209c615@suse.com>
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.
next prev parent reply other threads:[~2026-02-20 9:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 10:51 [PATCH v4 0/5] (v)PCI: extended capability handling Jan Beulich
2026-02-10 10:52 ` [PATCH v4 1/5] x86/PCI: avoid re-evaluation of extended config space accessibility Jan Beulich
2026-02-10 15:59 ` Stewart Hildebrand
2026-02-10 10:53 ` [PATCH v4 2/5] vPCI: introduce private header Jan Beulich
2026-02-17 22:04 ` Stewart Hildebrand
2026-02-18 8:52 ` Jan Beulich
2026-02-18 21:58 ` Stewart Hildebrand
2026-02-19 6:26 ` Jan Beulich
2026-02-10 10:54 ` [PATCH v4 3/5] vPCI: move vpci_init_capabilities() to a separate file Jan Beulich
2026-02-18 15:50 ` Stewart Hildebrand
2026-02-20 8:48 ` Roger Pau Monné
2026-02-10 10:54 ` [PATCH v4 4/5] vPCI: move capability-list init Jan Beulich
2026-02-18 20:54 ` Stewart Hildebrand
2026-02-20 8:59 ` Roger Pau Monné
2026-02-10 10:55 ` [PATCH v4 5/5] vPCI: re-init extended-capabilities when MMCFG availability changed Jan Beulich
2026-02-19 22:21 ` Stewart Hildebrand
2026-02-20 7:13 ` Jan Beulich
2026-02-20 9:08 ` Roger Pau Monné [this message]
2026-02-20 9:28 ` Roger Pau Monné
2026-02-20 10:20 ` Jan Beulich
2026-02-20 10:53 ` Roger Pau Monné
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aZgkouZccz3aUTeW@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=stewart.hildebrand@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.