iommu: Introduce device fault report API
authorJacob Pan <jacob.jun.pan@linux.intel.com>
Mon, 3 Jun 2019 14:57:48 +0000 (15:57 +0100)
committerJoerg Roedel <jroedel@suse.de>
Wed, 12 Jun 2019 08:19:06 +0000 (10:19 +0200)
commit0c830e6b32826311fc2b9ea1f4679be0f4ef0933
treeb6ce1ef8a4dc2b82bf53f45fff1c77c82426f43c
parent4e32348ba5269aac1165f496b78189201568dd8c
iommu: Introduce device fault report API

Traditionally, device specific faults are detected and handled within
their own device drivers. When IOMMU is enabled, faults such as DMA
related transactions are detected by IOMMU. There is no generic
reporting mechanism to report faults back to the in-kernel device
driver or the guest OS in case of assigned devices.

This patch introduces a registration API for device specific fault
handlers. This differs from the existing iommu_set_fault_handler/
report_iommu_fault infrastructures in several ways:
- it allows to report more sophisticated fault events (both
  unrecoverable faults and page request faults) due to the nature
  of the iommu_fault struct
- it is device specific and not domain specific.

The current iommu_report_device_fault() implementation only handles
the "shoot and forget" unrecoverable fault case. Handling of page
request faults or stalled faults will come later.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c
include/linux/iommu.h