• Lu Baolu's avatar
    iommufd: Add iommufd fault object · 07838f7f
    Lu Baolu authored
    An iommufd fault object provides an interface for delivering I/O page
    faults to user space. These objects are created and destroyed by user
    space, and they can be associated with or dissociated from hardware page
    table objects during page table allocation or destruction.
    
    User space interacts with the fault object through a file interface. This
    interface offers a straightforward and efficient way for user space to
    handle page faults. It allows user space to read fault messages
    sequentially and respond to them by writing to the same file. The file
    interface supports reading messages in poll mode, so it's recommended that
    user space applications use io_uring to enhance read and write efficiency.
    
    A fault object can be associated with any iopf-capable iommufd_hw_pgtable
    during the pgtable's allocation. All I/O page faults triggered by devices
    when accessing the I/O addresses of an iommufd_hw_pgtable are routed
    through the fault object to user space. Similarly, user space's responses
    to these page faults are routed back to the iommu device driver through
    the same fault object.
    
    Link: https://lore.kernel.org/r/20240702063444.105814-7-baolu.lu@linux.intel.comSigned-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
    Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    07838f7f
io-pgfault.c 15 KB