s390/cio: Split pfn_array_alloc_pin into pieces
authorEric Farman <farman@linux.ibm.com>
Tue, 14 May 2019 23:42:44 +0000 (01:42 +0200)
committerCornelia Huck <cohuck@redhat.com>
Mon, 3 Jun 2019 10:02:55 +0000 (12:02 +0200)
commite4f3f18b12324e2c140b97f93e3259eee9696d11
treebb793b61a30cad2c901adbfe0f6bf100292f9075
parent4e31d6aecfbbe63cf09b8fe48572d20d2062c406
s390/cio: Split pfn_array_alloc_pin into pieces

The pfn_array_alloc_pin routine is doing too much.  Today, it does the
alloc of the pfn_array struct and its member arrays, builds the iova
address lists out of a contiguous piece of guest memory, and asks vfio
to pin the resulting pages.

Let's effectively revert a significant portion of commit 5c1cfb1c3948
("vfio: ccw: refactor and improve pfn_array_alloc_pin()") such that we
break pfn_array_alloc_pin() into its component pieces, and have one
routine that allocates/populates the pfn_array structs, and another
that actually pins the memory.  In the future, we will be able to
handle scenarios where pinning memory isn't actually appropriate.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <20190514234248.36203-4-farman@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
drivers/s390/cio/vfio_ccw_cp.c