[PATCH v5 2/7] PCI/ATS: Validate STU for VFs in pci_prepare_ats()

Baolu Lu baolu.lu at linux.intel.com
Thu May 28 23:05:45 PDT 2026


On 5/29/26 04:23, Pranjal Shrivastava wrote:
> While every PCI Function that implements ATS has an independent ATS
> Extended Capability structure with a Read/Write Smallest Translation
> Unit (STU) field, the kernel manages SR-IOV ATS by requiring the IOMMU
> driver to configure the STU on the Physical Function (PF) before any
> any Virtual Functions (VFs) are created.
> 
> Currently, pci_prepare_ats() bails out early for VFs, assuming that the
> PF has already been correctly prepared. However, this creates a potential
> mismatch if a VF is subsequently prepared with a different page shift.
> 
> Update pci_prepare_ats() to validate that the requested page shift (ps)
> matches the STU already configured in the associated PF. This ensures
> early detection of incompatible configurations and maintains the kernel's
> policy of consistent STU sizing across all functions associated with a
> given SMMU.
> 
> Reviewed-by: Jason Gunthorpe<jgg at nvidia.com>
> Reviewed-by: Samiullah Khawaja<skhawaja at google.com>
> Reviewed-by: Nicolin Chen<nicolinc at nvidia.com>
> Signed-off-by: Pranjal Shrivastava<praan at google.com>
> ---
>   drivers/pci/ats.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Lu Baolu <baolu.lu at linux.intel.com>



More information about the linux-arm-kernel mailing list