Skip to content
  • Alexey Kardashevskiy's avatar
    vfio: powerpc/spapr: Moving pinning/unpinning to helpers · 649354b7
    Alexey Kardashevskiy authored
    
    
    This is a pretty mechanical patch to make next patches simpler.
    
    New tce_iommu_unuse_page() helper does put_page() now but it might skip
    that after the memory registering patch applied.
    
    As we are here, this removes unnecessary checks for a value returned
    by pfn_to_page() as it cannot possibly return NULL.
    
    This moves tce_iommu_disable() later to let tce_iommu_clear() know if
    the container has been enabled because if it has not been, then
    put_page() must not be called on TCEs from the TCE table. This situation
    is not yet possible but it will after KVM acceleration patchset is
    applied.
    
    This changes code to work with physical addresses rather than linear
    mapping addresses for better code readability. Following patches will
    add an xchg() callback for an IOMMU table which will accept/return
    physical addresses (unlike current tce_build()) which will eliminate
    redundant conversions.
    
    Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
    [aw: for the vfio related changes]
    Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Reviewed-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    649354b7