@@ -164,11 +164,13 @@ struct iommu_fault {
* this device if possible. This is "Response Failure" in PCI PRI.
* @IOMMU_PAGE_RESP_INVALID: Could not handle this fault, don't retry the
* access. This is "Invalid Request" in PCI PRI.
+ * @IOMMU_PAGE_RESP_ASYNC: Will response later by calling iommu_page_response().
*/
enum iommu_page_response_code {
IOMMU_PAGE_RESP_SUCCESS = 0,
IOMMU_PAGE_RESP_INVALID,
IOMMU_PAGE_RESP_FAILURE,
+ IOMMU_PAGE_RESP_ASYNC,
};
/**
@@ -96,7 +96,8 @@ static void iopf_handler(struct work_struct *work)
kfree(iopf);
}
- iopf_complete_group(group->dev, &group->last_fault, status);
+ if (status != IOMMU_PAGE_RESP_ASYNC)
+ iopf_complete_group(group->dev, &group->last_fault, status);
kfree(group);
}
Add a new page response code, IOMMU_PAGE_RESP_ASYNC, to indicate that the domain's page fault handler doesn't respond the hardware immediately, but do it in an asynchronous way. The use case of this response code is the nested translation, where the first-stage page table is owned by the VM guest and any page fault on it should be propagated to the VM guest and page fault will be responded in a different thread context later. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> --- include/linux/iommu.h | 2 ++ drivers/iommu/io-pgfault.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)