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 <[email protected]>
Jan