Received: by 10.223.185.116 with SMTP id b49csp2627728wrg; Mon, 5 Mar 2018 06:15:14 -0800 (PST) X-Google-Smtp-Source: AG47ELtrhuF9XmUoQD7NxiWPNwghTtBiRBt+9xO7/yi+kuYiVfku9zwl91lY2dllt2mP84vQDPdq X-Received: by 10.98.144.146 with SMTP id q18mr15733516pfk.103.1520259314466; Mon, 05 Mar 2018 06:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520259314; cv=none; d=google.com; s=arc-20160816; b=Gmt4YBANpiLihAymaUoUyXtWo1NE+/tyHOn8kRRkfeE4KJkuIhE3apkVUOzTbO1BcT NDbnmkCIk+L0vCxcqyswG3CmcEitye8aVcBiOpBUd2vU5bNnhVARLUoIShKj1GsQe7kr rL361hgRiAn1AYRxTKWdgZo0lwrk+LsaEzFWV6i74jVtWj947luALsvjsVNsNOJMqRzN kY5MRJO7edr7eDWCBoFLwTU+CBrmFEa5Witf63qiK/SARY1l6pb7mqCQIlH6h0arJ0xk 8/v8b8Ha5Y4xnC9Wfjm5U6XG0WY55GQWUBgVIIGjDHCVzSBTgmIEpJQdgfh8L1/Zou9X Dxag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=sIk3AlYhUU4YhwzzyzxGDVR77DN89xP6f3MWRQcPPW4=; b=g1q/kbDm69086QWnp7L3/grOJcTy8jxuLBN3w3S/Y3KBAjjpL0A6Sv6CsbRL+0P/ZK oFBUwffm6KeOrjOOT4SRqiOvqjeFfGBig6rH2WvIWd+PVukhbrkrTRqlRMpl/BpDigfu v61SX+S8Xg7ZJ5TyRxW1tFYQfZ6JuX8M7E8NWRl5dHbVtsB4cbFC0fM/Vwnrnixq6mAo /1IUEXGWZ9RzTz3ePlLwq7v6gxmL3ZCDL9TXg3voYstBH5DWjcQxlml+anIrnJ/GcCBK +2y41N6/nuB9GWDHb7wfqCjEuSZHjehwRDFCPAWe/uiGScYXiuHvpWYmZk0h+3NU88VH XkAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si10291592pfx.208.2018.03.05.06.15.00; Mon, 05 Mar 2018 06:15:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934766AbeCEMbc (ORCPT + 99 others); Mon, 5 Mar 2018 07:31:32 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59214 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933057AbeCEMbX (ORCPT ); Mon, 5 Mar 2018 07:31:23 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20EA1402314E; Mon, 5 Mar 2018 12:31:23 +0000 (UTC) Received: from localhost (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1F792024CA9; Mon, 5 Mar 2018 12:31:22 +0000 (UTC) From: Cornelia Huck To: Martin Schwidefsky , Heiko Carstens Cc: Dong Jia Shi , Halil Pasic , linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Cornelia Huck Subject: [PULL 2/2] vfio-ccw: fence off transport mode Date: Mon, 5 Mar 2018 13:31:16 +0100 Message-Id: <20180305123116.4301-3-cohuck@redhat.com> In-Reply-To: <20180305123116.4301-1-cohuck@redhat.com> References: <20180305123116.4301-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 05 Mar 2018 12:31:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 05 Mar 2018 12:31:23 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Halil Pasic 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) -- 2.13.6