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,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: Re: [PATCH v3] vpci: Add resizable bar support
Date: Mon, 16 Dec 2024 11:38:05 +0100	[thread overview]
Message-ID: <Z2ADDeTBVyv-W3vd@macbook.local> (raw)
In-Reply-To: <0773afe1-e892-4df5-a19e-25c55458e5cc@suse.com>

On Mon, Dec 16, 2024 at 11:30:22AM +0100, Jan Beulich wrote:
> On 16.12.2024 11:24, Roger Pau Monné wrote:
> > On Fri, Dec 13, 2024 at 01:42:32PM +0800, Jiqian Chen wrote:
> >> +static int cf_check init_rebar(struct pci_dev *pdev)
> >> +{
> >> +    uint32_t ctrl;
> >> +    unsigned int rebar_offset, nbars;
> >> +
> >> +    rebar_offset = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_REBAR);
> > 
> > You can do the init at definition:
> > 
> >     uint32_t ctrl;
> >     unsigned int nbars;
> >     unsigned int rebar_offset = pci_find_ext_capability(pdev->sbdf,
> >                                                         PCI_EXT_CAP_ID_REBAR);
> > 
> > 
> >> +
> >> +    if ( !rebar_offset )
> >> +        return 0;
> >> +
> >> +    if ( !is_hardware_domain(pdev->domain) )
> >> +    {
> >> +        printk("ReBar is not supported for domUs\n");
> > 
> > This needs a bit more information IMO:
> > 
> > printk(XENLOG_ERR
> >        "%pd %pp: resizable BAR capability not supported for unprivileged domains\n",
> >        pdev->domain, &pdev->sbdf);
> > 
> > I wonder if this should instead be an XSM check, but that would
> > require a new XSM hook to process permissions for PCI capabilities.
> 
> Ultimately perhaps, but right now we need to bail here irrespective of
> XSM policy, as the DomU side simply is unimplemented.

Yes, I should have said additionally rather than instead of the
is_hardware_domain() check.

Thanks, Roger.


  reply	other threads:[~2024-12-16 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13  5:42 [PATCH v3] vpci: Add resizable bar support Jiqian Chen
2024-12-16 10:24 ` Roger Pau Monné
2024-12-16 10:30   ` Jan Beulich
2024-12-16 10:38     ` Roger Pau Monné [this message]
2024-12-17  8:20   ` Chen, Jiqian
2024-12-17  8:49     ` Jan Beulich
2024-12-16 11:24 ` Jan Beulich
2024-12-17  8:22   ` Chen, Jiqian
2024-12-17  8:44     ` Jan Beulich
2024-12-17  9:35       ` Chen, Jiqian

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=Z2ADDeTBVyv-W3vd@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=Jiqian.Chen@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=ray.huang@amd.com \
    --cc=sstabellini@kernel.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.