On 18.11.2025 14:36, Mykyta Poturai wrote:
> @@ -1041,6 +1042,12 @@ enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn)
>      return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
>  }
>  
> +static bool __hwdom_init pdev_is_endpoint(const struct pci_dev *pdev)
> +{
> +    enum pdev_type type = pdev_type(pdev->seg, pdev->bus, pdev->devfn);
> +    return type == DEV_TYPE_PCIe_ENDPOINT || type == DEV_TYPE_PCI;

Once again - blank line please before the main return of a function (or, for
that matter, between declaration(s) and statement(s)).

> @@ -1221,6 +1228,10 @@ static int __hwdom_init cf_check 
> _setup_hwdom_pci_devices(
>              if ( !pdev )
>                  continue;
>  
> +            /* Hide real bridges from HWdom when it's using the emulated one 
> */
> +            if ( has_vpci_bridge(hardware_domain) && !pdev_is_endpoint(pdev) 
> )
> +                pci_hide_device(pdev->seg, pdev->bus, pdev->devfn);

As said elsewhere, when you hide bridges without introducing virtual 
counterparts,
everything behind the bridge also needs hiding.

Jan

Reply via email to