On 04.02.2025 14:54, Mykyta Poturai wrote:
> From: Stewart Hildebrand <[email protected]>
>
> Enable the use of IOMMU + PCI in dom0 without having to specify
> "pci-passthrough=yes". We rely on dom0 to initialize the PCI controller
> and perform a PHYSDEVOP_pci_device_add call to add each device to SMMU.
>
> Enable pci_init() for initializing Xen's internal PCI subsystem, and
> allow PHYSDEVOP_pci_device_add when pci-passthrough is disabled.
>
> is_pci_passthrough_enabled() is not an Arm-only construct, so remove the
> x86 definition of the function.
I can't see how x86 will continue to build correctly then. There's nowhere
else you introduce a replacement.
> --- a/xen/drivers/pci/physdev.c
> +++ b/xen/drivers/pci/physdev.c
> @@ -19,7 +19,7 @@ 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 ( !is_pci_passthrough_enabled() )
> + if ( !is_pci_passthrough_enabled() && !iommu_enabled )
> return -EOPNOTSUPP;
>
> ret = -EFAULT;
> @@ -57,7 +57,7 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void)
> arg)
> case PHYSDEVOP_pci_device_remove: {
> struct physdev_pci_device dev;
>
> - if ( !is_pci_passthrough_enabled() )
> + if ( !is_pci_passthrough_enabled() && !iommu_enabled )
> return -EOPNOTSUPP;
>
> ret = -EFAULT;
This is (potentially) a functional change each on x86, which I don't
think would be correct. "Potentially" because without seeing what the
new is_pci_passthrough_enabled() does this is impossible to determine.
Jan