aboutsummaryrefslogtreecommitdiff
path: root/include/uapi/linux/iommu.h
AgeCommit message (Collapse)AuthorFilesLines
2019-06-18iommu: Add padding to struct iommu_faultJean-Philippe Brucker1-0/+2
Ease future extensions of struct iommu_fault_page_request and struct iommu_fault_unrecoverable by adding a few bytes of padding. That way, a new field can be added to either of these structures by simply introducing a new flag. To extend it after the size limit is reached, a new fault reporting structure will have to be negotiated with userspace. With 56 bytes of padding, the total size of iommu_fault is 64 bytes and fits in a cache line on a lot of contemporary machines, while providing 16 and 24 bytes of extension to structures iommu_fault_page_request and iommu_fault_unrecoverable respectively. Signed-off-by: Jean-Philippe Brucker <[email protected]> Acked-by: Jacob Pan <[email protected]> Reviewed-by: Eric Auger <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
2019-06-12iommu: Add recoverable fault reportingJean-Philippe Brucker1-0/+35
Some IOMMU hardware features, for example PCI PRI and Arm SMMU Stall, enable recoverable I/O page faults. Allow IOMMU drivers to report PRI Page Requests and Stall events through the new fault reporting API. The consumer of the fault can be either an I/O page fault handler in the host, or a guest OS. Once handled, the fault must be completed by sending a page response back to the IOMMU. Add an iommu_page_response() function to complete a page fault. There are two ways to extend the userspace API: * Add a field to iommu_page_response and a flag to iommu_page_response::flags describing the validity of this field. * Introduce a new iommu_page_response_X structure with a different version number. The kernel must then support both versions. Signed-off-by: Jacob Pan <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
2019-06-12iommu: Introduce device fault dataJacob Pan1-0/+118
Device faults detected by IOMMU can be reported outside the IOMMU subsystem for further processing. This patch introduces a generic device fault data structure. The fault can be either an unrecoverable fault or a page request, also referred to as a recoverable fault. We only care about non internal faults that are likely to be reported to an external subsystem. Signed-off-by: Jacob Pan <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Liu, Yi L <[email protected]> Signed-off-by: Ashok Raj <[email protected]> Signed-off-by: Eric Auger <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>