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: Stewart Hildebrand <stewart.hildebrand@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v9 2/2] xen/vpci: header: filter PCI capabilities
Date: Mon, 4 Dec 2023 15:11:12 +0100	[thread overview]
Message-ID: <ZW3eAAb9TvSIup8J@macbook> (raw)
In-Reply-To: <11674268-4da3-4f20-909c-43b94bdfad2e@suse.com>

On Mon, Dec 04, 2023 at 12:48:00PM +0100, Jan Beulich wrote:
> On 01.12.2023 16:45, Stewart Hildebrand wrote:
> > --- a/xen/drivers/pci/pci.c
> > +++ b/xen/drivers/pci/pci.c
> > @@ -39,31 +39,42 @@ unsigned int pci_find_cap_offset(pci_sbdf_t sbdf, unsigned int cap)
> >      return 0;
> >  }
> >  
> > -unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
> > -                               unsigned int cap)
> > +unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
> > +                                   const unsigned int *cap, unsigned int n,
> 
> Imo this would better be written as cap[] (or even caps[]).
> 
> > @@ -545,6 +546,68 @@ static int cf_check init_bars(struct pci_dev *pdev)
> >      if ( rc )
> >          return rc;
> >  
> > +    if ( !is_hardware_domain(pdev->domain) )
> > +    {
> > +        if ( pci_conf_read16(pdev->sbdf, PCI_STATUS) & PCI_STATUS_CAP_LIST )
> > +        {
> > +            /* Only expose capabilities to the guest that vPCI can handle. */
> > +            unsigned int next, ttl = 48;
> > +            const unsigned int supported_caps[] = {
> > +                PCI_CAP_ID_MSI,
> > +                PCI_CAP_ID_MSIX,
> > +            };
> 
> static?
> 
> With the two adjustments
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

FTAOD: please also keep my RB when doing those adjustments.

Thanks, Roger.


      reply	other threads:[~2023-12-04 14:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-01 15:45 [PATCH v9 0/2] vPCI capabilities filtering Stewart Hildebrand
2023-12-01 15:45 ` [PATCH v9 1/2] xen/vpci: header: status register handler Stewart Hildebrand
2023-12-04 14:10   ` Roger Pau Monné
2023-12-01 15:45 ` [PATCH v9 2/2] xen/vpci: header: filter PCI capabilities Stewart Hildebrand
2023-12-04 11:48   ` Jan Beulich
2023-12-04 14:11     ` 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=ZW3eAAb9TvSIup8J@macbook \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=stewart.hildebrand@amd.com \
    --cc=wl@xen.org \
    --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.