On 24.09.2025 09:59, Mykyta Poturai wrote:
> From: Luca Fancellu <[email protected]>
> 
> On ARM, if the hardware domain is using the emulated bus, it should not
> be allowed to add/remove pci devices, so return EOPNOTSUPP in that case.

And how exactly would PCI hotplug be made work then?

> --- a/xen/drivers/pci/physdev.c
> +++ b/xen/drivers/pci/physdev.c
> @@ -19,6 +19,9 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
> arg)
>          struct pci_dev_info pdev_info;
>          nodeid_t node = NUMA_NO_NODE;
>  
> +        if ( hwdom_uses_vpci() )
> +            return -EOPNOTSUPP;
> +
>          if ( !is_pci_passthrough_enabled() && !arch_pci_device_physdevop() )
>              return -EOPNOTSUPP;
>  
> @@ -57,6 +60,9 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) 
> arg)
>      case PHYSDEVOP_pci_device_remove: {
>          struct physdev_pci_device dev;
>  
> +        if ( hwdom_uses_vpci() )
> +            return -EOPNOTSUPP;
> +
>          if ( !is_pci_passthrough_enabled() && !arch_pci_device_physdevop() )
>              return -EOPNOTSUPP;
>  

Along the lines of my comment on patch 3, these uses are clearly _visually_
wrong for x86; they're correct from a functional perspective simply because
the predicate returns the (apparently) wrong value there right now.

Jan

Reply via email to