From: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx>could you extend it with your earlier reply?
Sent: Friday, February 28, 2025 5:26 PM
Device ATS is currently enabled when a domain is attached to the device
and disabled when the domain is detached. This creates a limitation:
when the IOMMU is operating in scalable mode and IOPF is enabled, the
device's domain cannot be changed.
https://lore.kernel.org/linux-iommu/6a418974-d06e-46e3-879f- ab4c84a95231@xxxxxxxxxxxxxxx/
-static void iommu_enable_pci_caps(struct device_domain_info *info)still prefer to some comment above as you explained in above
+static void iommu_enable_pci_ats(struct device_domain_info *info)
{
struct pci_dev *pdev;
- if (!dev_is_pci(info->dev))
+ if (!info->ats_supported)
return;
pdev = to_pci_dev(info->dev);
- if (info->ats_supported && pci_ats_page_aligned(pdev) &&
- !pci_enable_ats(pdev, VTD_PAGE_SHIFT))
+ if (!pci_ats_page_aligned(pdev))
+ return;
+
+ if (!pci_enable_ats(pdev, VTD_PAGE_SHIFT))
info->ats_enabled = 1;
}
reply. It's not obvious w/o knowing the tricky background.