Re: [PATCH v4 08/18] PCI: Account for Direct Translated P2P in ACS isolation checks

Logan Gunthorpe <[email protected]>
Newsgroups org.kernel.vger.linux-doc,dev.linux.lists.iommu,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci
Message-ID <[email protected]>

On 2026-08-21 13:38, Leon Romanovsky wrote:
> From: Leon Romanovsky <[email protected]>
> 
> PCIe r7.0, sec 6.12.3:
> 
>   peer-to-peer Memory Requests whose Address Type (AT) field indicates a
>   Translated address must be routed to the peer Port/Function without
>   redirection, regardless of ACS P2P Request Redirect and ACS P2P Egress
>   Control settings.
> 
> Request Redirect therefore does not isolate devices below a Port with
> ACS Direct Translated P2P enabled.
> 
> Sec 6.12.1.1 makes such a Request an ACS Violation once Translation
> Blocking is enabled, and that error "must take precedence over ... ACS
> P2P control mechanisms". Report isolation only in that case. Without
> Translation Blocking, devices below such a Port now share an IOMMU
> group.
> 
> This only holds for a caller that needs Request Redirect to isolate
> peers. pci_enable_pasid() asks for Request Redirect for a different
> reason: a Request carrying a PASID is routed by address alone (sec
> 2.2.10.4), so it has to be redirected Upstream to reach the translation
> agent. Direct Translated P2P says nothing about that, because a
> Translated Request already carries an address the agent produced for
> that PASID (sec 10.1.3).
> 
> Give pci_acs_enabled() and pci_acs_path_enabled() a scope so each caller
> states which Requests its answer has to cover, and apply the rule above
> only for PCI_ACS_SCOPE_ALL.
> 
> pci_acs_flags_enabled() and the Intel SPT PCH quirk both need the rule,
> so it lives in pci_acs_rr_ineffective().
> 
> Tested-by: Tushar Dave <[email protected]>
> Fixes: ad805758c0eb ("PCI: add ACS validation utility")
> Signed-off-by: Leon Romanovsky <[email protected]>

Looks, ok to me:

Reviewed-by: Logan Gunthorpe <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.