vfio/ccw: simplify CCW chain fetch routines
authorEric Farman <farman@linux.ibm.com>
Fri, 21 Oct 2022 13:32:30 +0000 (15:32 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:34:07 +0000 (14:34 +0100)
commita4c6040472ba638f2719f371fad92c83365f7332
tree6f6c52bea8bc20b724b324c266773f200f891d76
parentc5e8083f9580bd7b32ca3967e3d2f99b38cfdaa6
vfio/ccw: simplify CCW chain fetch routines

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: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/vfio_ccw_cp.c