Skip to content
Commit b022f597 authored by Fenghua Yu's avatar Fenghua Yu Committed by Vinod Koul
Browse files

dmaengine: idxd: add idxd_copy_cr() to copy user completion record during page fault handling



Define idxd_copy_cr() to copy completion record to fault address in
user address that is found by work queue (wq) and PASID.

It will be used to write the user's completion record that the hardware
device is not able to write due to user completion record page fault.

An xarray is added to associate the PASID and mm with the
struct idxd_user_context so mm can be found by PASID and wq.

It is called when handling the completion record fault in a kernel thread
context. Switch to the mm using kthread_use_vm() and copy the
completion record to the mm via copy_to_user(). Once the copy is
completed, switch back to the current mm using kthread_unuse_mm().

Suggested-by: default avatarChristoph Hellwig <hch@infradead.org>
Suggested-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Suggested-by: default avatarTony Luck <tony.luck@intel.com>
Tested-by: default avatarTony Zhu <tony.zhu@intel.com>
Signed-off-by: default avatarFenghua Yu <fenghua.yu@intel.com>
Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20230407203143.2189681-9-fenghua.yu@intel.com
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent c2f156bf
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment