• Eric Farman's avatar
    vfio/ccw: populate page_array struct inline · 61783394
    Eric Farman authored
    There are two possible ways the list of addresses that get passed
    to vfio are calculated. One is from a guest IDAL, which would be
    an array of (probably) non-contiguous addresses. The other is
    built from contiguous pages that follow the starting address
    provided by ccw->cda.
    
    page_array_alloc() attempts to simplify things by pre-populating
    this array from the starting address, but that's not needed for
    a CCW with an IDAL anyway so doesn't need to be in the allocator.
    Move it to the caller in the non-IDAL case, since it will be
    overwritten when reading the guest IDAL.
    
    Remove the initialization of the pa_page output pointers,
    since it won't be explicitly needed for either case.
    Signed-off-by: default avatarEric Farman <farman@linux.ibm.com>
    Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    61783394
vfio_ccw_cp.c 21.8 KB