vfio/ccw: populate page_array struct inline
authorEric Farman <farman@linux.ibm.com>
Fri, 21 Oct 2022 15:02:48 +0000 (17:02 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:34:08 +0000 (14:34 +0100)
commit61783394f4eb3a8a0944005ea2761c011788a9c3
treea96479ffcfb2be7092010909f69ae4b3b945bc2a
parent62a97a56a64c97c3865e55d702babc22f3b2ea6a
vfio/ccw: populate page_array struct inline

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: 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