• Eric Farman's avatar
    vfio/ccw: simplify CCW chain fetch routines · a4c60404
    Eric Farman authored
    The act of processing a fetched CCW has two components:
    
     1) Process a Transfer-in-channel (TIC) CCW
     2) Process any other CCW
    
    The former needs to look at whether the TIC jumps backwards into
    the current channel program or forwards into a new segment,
    while the latter just processes the CCW data address itself.
    
    Rather than passing the chain segment and index within it to the
    handlers for the above, and requiring each to calculate the
    elements it needs, simply pass the needed pointers directly.
    
    For the TIC, that means the CCW being processed and the location
    of the entire channel program which holds all segments. For the
    other CCWs, the page_array pointer is also needed to perform the
    page pinning, etc.
    
    While at it, rename ccwchain_fetch_direct to _ccw, to indicate
    what it is. The name "_direct" is historical, when it used to
    process a direct-addressed CCW, but IDAs are processed here too.
    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>
    a4c60404
vfio_ccw_cp.c 22.1 KB