All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stewart Hildebrand <stewart.hildebrand@amd.com>
Subject: Re: [PATCH v3 6/6] vPCI: re-init extended-capability lists when MMCFG availability changed
Date: Thu, 29 Jan 2026 18:41:18 +0100	[thread overview]
Message-ID: <aXubviEH78wFkOT5@Mac.lan> (raw)
In-Reply-To: <45ea72d4-bbc6-49b9-8d29-d18876dd187d@suse.com>

On Thu, Jan 29, 2026 at 04:54:59PM +0100, Jan Beulich wrote:
> On 29.01.2026 16:40, Roger Pau Monné wrote:
> > On Thu, Jan 29, 2026 at 02:10:34PM +0100, Jan Beulich wrote:
> >> --- a/xen/drivers/vpci/header.c
> >> +++ b/xen/drivers/vpci/header.c
> >> @@ -869,6 +869,18 @@ static int vpci_init_ext_capability_list
> >>      return 0;
> >>  }
> >>  
> >> +int vpci_reinit_ext_capability_list(const struct pci_dev *pdev)
> >> +{
> >> +    if ( !pdev->vpci )
> >> +        return 0;
> >> +
> >> +    if ( vpci_remove_registers(pdev->vpci, PCI_CFG_SPACE_SIZE,
> >> +                               PCI_CFG_SPACE_EXP_SIZE - PCI_CFG_SPACE_SIZE) )
> >> +        ASSERT_UNREACHABLE();
> >> +
> >> +    return vpci_init_ext_capability_list(pdev);
> > 
> > Isn't this missing the possible addition or removal of managed
> > extended capabilities?  IOW: on removal of access to the extended
> > space the vPCI managed capabilties that have is_ext == true should
> > call their ->cleanup() hooks, and on discovery of MMCFG access we
> > should call the ->init() hooks?
> 
> Now I know why this felt too easy. Yet I wonder: Why is this done in two
> parts in the first place?

I think this boils down to us (me I would think) not planning ahead
that capabilities might appear _after_ the initial device assignation.
This is true for example when Xen doesn't have access to the MMCFG at
boot, and it's only made aware of such after starting the hardware
domain.

Right now vpci_init_{,ext_}capability_list() is called from
vpci_init_header(), but for the case where MMCFG is registered late we
don't really want to re-init the header, so calling that helper is not
an option.

We might want to create two new wrappers that encapsulate
vpci_init_{,ext_}capability_list() + the calling of the
vpci_init_capabilities(), provided that vpci_init_capabilities() is
also split between legacy and extended capabilities.  We want to call
those new helpers from vpci_assign_device() instead of
vpci_init_header().

Thanks, Roger.


      reply	other threads:[~2026-01-29 17:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 13:05 [PATCH v3 0/6] (v)PCI: extended capability handling Jan Beulich
2026-01-29 13:07 ` [PATCH v3 1/6] PCI: handle PCI->PCIe bridges as well in free_pdev() Jan Beulich
2026-01-29 13:49   ` Roger Pau Monné
2026-01-29 13:08 ` [PATCH v3 2/6] PCI: determine whether a device has extended config space Jan Beulich
2026-01-29 14:09   ` Roger Pau Monné
2026-01-29 14:17     ` Jan Beulich
2026-02-02  9:14   ` Jan Beulich
2026-02-02  9:21     ` Roger Pau Monné
2026-01-29 13:08 ` [PATCH v3 3/6] PCI: don't look for ext-caps when there's no extended cfg space Jan Beulich
2026-01-29 13:09 ` [PATCH v3 4/6] vPCI: really no ext-caps without extended config space Jan Beulich
2026-01-29 14:13   ` Roger Pau Monné
2026-01-29 13:10 ` [PATCH v3 5/6] x86/PCI: avoid re-evaluation of extended config space accessibility Jan Beulich
2026-01-29 15:32   ` Roger Pau Monné
2026-01-29 15:47     ` Jan Beulich
2026-02-02  8:51   ` Jan Beulich
2026-02-02  9:14     ` Roger Pau Monné
2026-02-02  9:30       ` Jan Beulich
2026-02-02 10:13         ` Roger Pau Monné
2026-02-02 14:40           ` Jan Beulich
2026-02-02 15:18             ` Roger Pau Monné
2026-02-03 14:48               ` Jan Beulich
2026-02-03 17:19                 ` Roger Pau Monné
2026-02-02 19:25     ` Stewart Hildebrand
2026-01-29 13:10 ` [PATCH v3 6/6] vPCI: re-init extended-capability lists when MMCFG availability changed Jan Beulich
2026-01-29 15:40   ` Roger Pau Monné
2026-01-29 15:54     ` Jan Beulich
2026-01-29 17:41       ` Roger Pau Monné [this message]

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=aXubviEH78wFkOT5@Mac.lan \
    --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.