• J
    iommu: Add a process_exit callback for device drivers · ad9f5b52
    Jean-Philippe Brucker 提交于
    ascend inclusion
    category: feature
    bugzilla: 14369
    CVE: NA
    
    --------------
    
    IOMMU drivers need a way to bind Linux processes to devices. This is used
    for Shared Virtual Memory (SVM), where devices support paging. In that
    mode, DMA can directly target virtual addresses of a process.
    
    Introduce boilerplate code for allocating process structures and binding
    them to devices. Four operations are added to IOMMU drivers:
    
    When a process exits, we need to ensure that devices attached to it stop
    issuing transactions with its PASID. Let device drivers register a
    callback to be notified on process exit.
    
    At the moment the callback is set on the domain like the fault handler,
    because we don't have a structure available for IOMMU masters. This can
    become problematic if different devices in a domain are managed by
    distinct device drivers (for example multiple devices in the same group).
    The problem is the same for the fault handler, so we'll probably fix them
    all at once.
    Signed-off-by: NJean-Philippe Brucker <jean-philippe.brucker@arm.com>
    Signed-off-by: NFang Lijun <fanglijun3@huawei.com>
    Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    ad9f5b52
iommu-process.c 2.0 KB