aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Farman <farman@linux.ibm.com>2019-06-18 22:23:49 +0200
committerCornelia Huck <cohuck@redhat.com>2019-06-21 14:12:29 +0200
commit6246590230e9c1225d2ce8d0160376b4d5511281 (patch)
treefcdd550725a592df9273e0ebfa43e7e095a785ef
parentvfio-ccw: Move guest_cp storage into common struct (diff)
downloadlinux-dev-6246590230e9c1225d2ce8d0160376b4d5511281.tar.xz
linux-dev-6246590230e9c1225d2ce8d0160376b4d5511281.zip
vfio-ccw: Skip second copy of guest cp to host
We already pinned/copied/unpinned 2K (256 CCWs) of guest memory to the host space anchored off vfio_ccw_private. There's no need to do that again once we have the length calculated, when we could just copy the section we need to the "permanent" space for the I/O. Signed-off-by: Eric Farman <farman@linux.ibm.com> Message-Id: <20190618202352.39702-3-farman@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Farhan Ali <alifm@linux.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
-rw-r--r--drivers/s390/cio/vfio_ccw_cp.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.c b/drivers/s390/cio/vfio_ccw_cp.c
index f358502376be..37d513e86530 100644
--- a/drivers/s390/cio/vfio_ccw_cp.c
+++ b/drivers/s390/cio/vfio_ccw_cp.c
@@ -444,7 +444,7 @@ static int ccwchain_loop_tic(struct ccwchain *chain,
static int ccwchain_handle_ccw(u32 cda, struct channel_program *cp)
{
struct ccwchain *chain;
- int len, ret;
+ int len;
/* Copy the chain from cda to cp, and count the CCWs in it */
len = ccwchain_calc_length(cda, cp);
@@ -457,12 +457,8 @@ static int ccwchain_handle_ccw(u32 cda, struct channel_program *cp)
return -ENOMEM;
chain->ch_iova = cda;
- /* Copy the new chain from user. */
- ret = copy_ccw_from_iova(cp, chain->ch_ccw, cda, len);
- if (ret) {
- ccwchain_free(chain);
- return ret;
- }
+ /* Copy the actual CCWs into the new chain */
+ memcpy(chain->ch_ccw, cp->guest_cp, len * sizeof(struct ccw1));
/* Loop for tics on this new chain. */
return ccwchain_loop_tic(chain, cp);