• Alexey Kardashevskiy's avatar
    powerpc/mm/iommu/vfio_spapr_tce: Change mm_iommu_get to reference a region · e0bf78b0
    Alexey Kardashevskiy authored
    Normally mm_iommu_get() should add a reference and mm_iommu_put() should
    remove it. However historically mm_iommu_find() does the referencing and
    mm_iommu_get() is doing allocation and referencing.
    
    We are going to add another helper to preregister device memory so
    instead of having mm_iommu_new() (which pre-registers the normal memory
    and references the region), we need separate helpers for pre-registering
    and referencing.
    
    This renames:
    - mm_iommu_get to mm_iommu_new;
    - mm_iommu_find to mm_iommu_get.
    
    This changes mm_iommu_get() to reference the region so the name now
    reflects what it does.
    
    This removes the check for exact match from mm_iommu_new() as we want it
    to fail on existing regions; mm_iommu_get() should be used instead.
    Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
    Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    e0bf78b0
vfio_iommu_spapr_tce.c 32.8 KB