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

Re: [PATCH v3] vpci: Add resizable bar support



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.



 


Rackspace

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