On 24.07.2025 11:44, Mykyta Poturai wrote:
> From: Stewart Hildebrand <stewart.hildebr...@amd.com>
> 
> Enable the use of IOMMU + PCI in dom0 without having to specify
> "pci-passthrough=yes". Due to possible platform specific dependencies
> of the PCI host, we rely on dom0 to initialize it and perform
> a PCI PHYSDEVOP calls to add each device to SMMU.
> 
> Because pci_passthrough is not always enabled on all architectures, add
> a new function arch_pci_device_physdevop that checks if we need to enable
> a subset of the PCI subsystem related to managing IOMMU configuration
> for PCI devices.
> 
> Enable pci_init() for initializing Xen's internal PCI subsystem, and
> allow PCI PHYSDEV ops when pci-passthrough is disabled.
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebr...@amd.com>
> Signed-off-by: Mykyta Poturai <mykyta_potu...@epam.com>
> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org>

Acked-by: Jan Beulich <jbeul...@suse.com>

Nevertheless I'd like to point out that ...

> --- a/xen/arch/x86/include/asm/pci.h
> +++ b/xen/arch/x86/include/asm/pci.h
> @@ -57,6 +57,16 @@ static always_inline bool is_pci_passthrough_enabled(void)
>      return true;
>  }
>  
> +/*
> + * Since PCI passthrough is always enabled on x86, physdevop handling doesn't
> + * need special arch-specific behavior. Current call sites work with either
> + * return value, but true is more consistent with passthrough being enabled.
> + */
> +static inline bool arch_pci_device_physdevop(void)
> +{
> +    return true;
> +}

... the comment still isn't quite right. PCI-passthrough isn't always enabled
on x86. Both AMD_IOMMU and INTEL_IOMMU Kconfig options can be used to turn
respective support off. Things then work as if no IOMMU was found, which
means largely "no pass-through".

Jan

Reply via email to