• Alexey Kardashevskiy's avatar
    vfio/spapr: Postpone default window creation · d9c72894
    Alexey Kardashevskiy authored
    We are going to allow the userspace to configure container in
    one memory context and pass container fd to another so
    we are postponing memory allocations accounted against
    the locked memory limit. One of previous patches took care of
    it_userspace.
    
    At the moment we create the default DMA window when the first group is
    attached to a container; this is done for the userspace which is not
    DDW-aware but familiar with the SPAPR TCE IOMMU v2 in the part of memory
    pre-registration - such client expects the default DMA window to exist.
    
    This postpones the default DMA window allocation till one of
    the folliwing happens:
    1. first map/unmap request arrives;
    2. new window is requested;
    This adds noop for the case when the userspace requested removal
    of the default window which has not been created yet.
    Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
    Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    Acked-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    d9c72894
vfio_iommu_spapr_tce.c 30.1 KB