Ensuring a system can handle unexpected address patterns or workload distributions without compromising performance and security.
Address Translation Services (ATS) is a mechanism in PCIe that allows devices to request address translations from the Input/Output Memory Management Unit (IOMMU). This is particularly important where devices need to access virtual memory. ATS enhances performance by enabling devices to cache translations, reducing the latency associated with memory access. This blog delves into the semantics of ATS request-completion protocol and Invalidation protocol. It also addresses key verification challenges that verification engineers might face while covering the error scenarios at various stages of verification.
ATS uses a request-completion protocol between a device and a Root Complex (RC).
ATS uses invalidate request-completion protocol between a device and an RC and ensures that the cached address translations are not stale.
The translation request format is like a memory read in both Non-Flit Mode (NFM) or Flit Mode (FM), where Address Type (AT) bits identify that it is going to be a translation request. In FM, the Orthogonal Header Content (OHC) encoding adds OHC-A1 Double Word (DW) in the packet header, including information like No Write (NW), explicit byte enables and/or Process Address Space ID (PASID) fields. These translation requests are not Direct Memory Access (DMA) transactions.
The translation completions format is like the data completions. For a translation completion, the Relaxed Ordering (RO) bit is applicable and permitted to be set if the corresponding translation request RO bit was set. Completion data contains:
Completion can have multiple translated addresses. If the TA was not able to perform the requested translation, the completion with no data (Cpl) must be returned. The OHC-A5 DW in the packet header is required for unsuccessful completions and for completions with lower address [1:0] not equal to 00b.
An invalidate request clears a specific subset of the address range from the ATC when translation is changed in TA. The invalidate request is a message with a data transaction with 64 bits of data. The message payload contains the untranslated address range to be invalidated, and the ITag field is used by the TA to uniquely identify invalidate requests. In FM, PASID is included when OHC-A4 DW is present and the PV bit is set.
An invalidate completion is a message transaction that must contain the requester ID used in the associated invalidate request. All fragments of an invalidate completion must have an identical request ID, Completion Count (CC), and ITag vector fields.
The verification challenges mentioned below need to be taken care of by the verification engineer by building the randomized test scenarios, designing the automated checkers, and assertions that can seamlessly be integrated into the verification environment.
Consistency
Coherency
Correctness of translations
Performance
Scalability
Security
The verification challenges of ATS in PCIe systems highlight the need to ensure consistency, correctness, and coherency of address translations. It addresses the importance of maintaining access permissions, managing performance impacts, and handling security concerns such as OHC and PASID attributes. By employing randomization test scenarios, one can ensure that the system can handle unexpected address patterns or workload distributions without compromising performance and security.
Leave a Reply