From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422787AbeCBMDT (ORCPT ); Fri, 2 Mar 2018 07:03:19 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936177AbeCBMDL (ORCPT ); Fri, 2 Mar 2018 07:03:11 -0500 Date: Fri, 2 Mar 2018 13:03:07 +0100 From: Cornelia Huck To: Dong Jia Shi , Halil Pasic Cc: linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] vfio-ccw: fence off transport mode Message-ID: <20180302130307.76b3f65e.cohuck@redhat.com> In-Reply-To: <20180222153959.31272-2-cohuck@redhat.com> References: <20180222153959.31272-1-cohuck@redhat.com> <20180222153959.31272-2-cohuck@redhat.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Feb 2018 16:39:59 +0100 Cornelia Huck wrote: > 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. > > Signed-off-by: Cornelia Huck > --- > drivers/s390/cio/vfio_ccw_fsm.c | 5 +++++ > 1 file changed, 5 insertions(+) > > 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, > if (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) { > orb = (union orb *)io_region->orb_area; > > + /* Don't try to build a cp if transport mode is specified. */ > + if (orb->tm.b) { > + io_region->ret_code = -EOPNOTSUPP; > + goto err_out; > + } > io_region->ret_code = cp_init(&private->cp, mdev_dev(mdev), > orb); > if (io_region->ret_code) Queued. I'll probably send a pull request next week.