diff options
author | Cornelia Huck <cohuck@redhat.com> | 2018-02-22 09:35:43 -0500 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-03-01 11:35:50 -0500 |
commit | 9851bc77e62499957567e7c39a5beba7d6de6296 (patch) | |
tree | 97863d73226b6dc397ad2e7527b5d61e0f6ba889 | |
parent | 69cfd92ea4289b16be6e77960f5d0ab2ddc540a7 (diff) |
vfio-ccw: fence off transport mode
vfio-ccw only supports command mode for channel programs, not transport
mode. User space is supposed to already take care of that and pass us
command-mode ORBs only, but better make sure and return an error to
the caller instead of trying to process tcws as ccws.
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Acked-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
-rw-r--r-- | drivers/s390/cio/vfio_ccw_fsm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/s390/cio/vfio_ccw_fsm.c b/drivers/s390/cio/vfio_ccw_fsm.c index c30420c517b1..ff6963ad6e39 100644 --- a/drivers/s390/cio/vfio_ccw_fsm.c +++ b/drivers/s390/cio/vfio_ccw_fsm.c | |||
@@ -124,6 +124,11 @@ static void fsm_io_request(struct vfio_ccw_private *private, | |||
124 | if (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) { | 124 | if (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) { |
125 | orb = (union orb *)io_region->orb_area; | 125 | orb = (union orb *)io_region->orb_area; |
126 | 126 | ||
127 | /* Don't try to build a cp if transport mode is specified. */ | ||
128 | if (orb->tm.b) { | ||
129 | io_region->ret_code = -EOPNOTSUPP; | ||
130 | goto err_out; | ||
131 | } | ||
127 | io_region->ret_code = cp_init(&private->cp, mdev_dev(mdev), | 132 | io_region->ret_code = cp_init(&private->cp, mdev_dev(mdev), |
128 | orb); | 133 | orb); |
129 | if (io_region->ret_code) | 134 | if (io_region->ret_code) |