Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1738419ybj; Wed, 6 May 2020 04:31:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJesNqrP0JBuilWYMio14YkqK9GtQHhN4/h5+CuBlQKhD4OpBKiE8+58A85HV62T53sBAV8 X-Received: by 2002:a50:8b42:: with SMTP id l60mr716394edl.55.1588764666406; Wed, 06 May 2020 04:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588764666; cv=none; d=google.com; s=arc-20160816; b=B2gJx37FpXK2M397CwcdjaIke+OMU8SNMkIOF7Mt+6CLc5pAF80i+oCVgPL4WjJO5i PbA+lai1AfJVCsZBfI4bq2T9LyivC7009oIjZn25EsVWpv6WF2p4MA3fLPK/4tD+x3dw mTHg/R1nDv0MqaTUUHT4bQbDMdEplAdyIBLxcrCPOuZN0HPHfRcuh9Ze6I9/C2EN77uA nEhLJ0pnA45GjKDeZKeR4cGKajUm7+2pM6zw9txwGdlyKCWCtmLxLK26l4nYMgbFkLL/ BIC/7gL/Z6BuSLsnrtJtowK4qzg6gaKmQfutV+OqzgLhVJjtTo/2oBWr/ATc9Xg2whAt jzJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=/Qr0XiLssBUP1KzSEARJHgF0bv5jIGk/42Em4vy6c0w=; b=ZQurOMtHqHtnZ0EG/FfdpnCIhTM577nrbVu2whki3rjBaCy+d7999J0CYjh3dPZ83Q Pq3bn7g/UBz2Qd/rqnSpC4LuWivZREUDFBTk0Y5ghys7gKfn0RtV8QWCNgd1w2Dy8456 fstolJrQaaae0u2lEMYG6Eo4pp2IsVK/t0w/uTtuVzvnqI0YttNB4JUSIvWfNicwe7aa xIhxiFVH8Kbdh4FXbVF+r/vcuQfq/C7KcwYXCaz0Fc3LZP4GSAZMmBX7uLzi6njPZXAH 8/8BkJOWQnB4RhA1qDFkFXybUtbqTiVTboa4EkmUog34G90P+GErpR+wWewkbHT/po8F UaIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BNUQwYnn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qo6si973680ejb.204.2020.05.06.04.30.43; Wed, 06 May 2020 04:31:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BNUQwYnn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbgEFLYi (ORCPT + 99 others); Wed, 6 May 2020 07:24:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46921 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726712AbgEFLYi (ORCPT ); Wed, 6 May 2020 07:24:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588764276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/Qr0XiLssBUP1KzSEARJHgF0bv5jIGk/42Em4vy6c0w=; b=BNUQwYnnGThARz+grob2z/FTy3vGBMPZSazayKiR91WoRCk6KT7qkz/+KfuvB7LZXh7vCY D1jSG4iIxGYgX8f8hL3rpVa6duaWBzSAqz1OwLC4rXJZNk0rCLetoDE4BSbLOBLpz0iFws eD2Bk8Sb1tf9aEqZKDvjp6QobZpcZ3c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-7gDtz1ExOEa6CAGZiSQbdw-1; Wed, 06 May 2020 07:24:33 -0400 X-MC-Unique: 7gDtz1ExOEa6CAGZiSQbdw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DCE1107ACCA; Wed, 6 May 2020 11:24:32 +0000 (UTC) Received: from gondolin (ovpn-112-211.ams2.redhat.com [10.36.112.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id A307399CF; Wed, 6 May 2020 11:24:30 +0000 (UTC) Date: Wed, 6 May 2020 13:24:27 +0200 From: Cornelia Huck To: Jared Rossi Cc: Eric Farman , Halil Pasic , linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/1] vfio-ccw: Enable transparent CCW IPL from DASD Message-ID: <20200506132427.2f64a07d.cohuck@redhat.com> In-Reply-To: <20200506001544.16213-2-jrossi@linux.ibm.com> References: <20200506001544.16213-1-jrossi@linux.ibm.com> <20200506001544.16213-2-jrossi@linux.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 May 2020 20:15:44 -0400 Jared Rossi wrote: > Remove the explicit prefetch check when using vfio-ccw devices. > This check does not trigger in practice as all Linux channel programs > are intended to use prefetch. > > It is expected that all ORBs issued by Linux will request prefetch. > Although non-prefetching ORBs are not rejected, they will prefetch > nonetheless. A warning is issued up to once per 5 seconds when a > forced prefetch occurs. > > A non-prefetch ORB does not necessarily result in an error, however > frequent encounters with non-prefetch ORBs indicate that channel > programs are being executed in a way that is inconsistent with what > the guest is requesting. While there is currently no known case of an > error caused by forced prefetch, it is possible in theory that forced > prefetch could result in an error if applied to a channel program that > is dependent on non-prefetch. > > Signed-off-by: Jared Rossi > --- > Documentation/s390/vfio-ccw.rst | 6 ++++++ > drivers/s390/cio/vfio_ccw_cp.c | 19 ++++++++++++------- > 2 files changed, 18 insertions(+), 7 deletions(-) > (...) > @@ -625,23 +626,27 @@ static int ccwchain_fetch_one(struct ccwchain *chain, > * the target channel program from @orb->cmd.iova to the new ccwchain(s). > * > * Limitations: > - * 1. Supports only prefetch enabled mode. > - * 2. Supports idal(c64) ccw chaining. > - * 3. Supports 4k idaw. > + * 1. Supports idal(c64) ccw chaining. > + * 2. Supports 4k idaw. > * > * Returns: > * %0 on success and a negative error value on failure. > */ > int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) > { > + static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 1); > int ret; > > /* > - * XXX: > - * Only support prefetch enable mode now. > + * We only support prefetching the channel program. We assume all channel > + * programs executed by supported guests (i.e. Linux) likewise support > + * prefetching. Even if prefetching is not specified the channel program > + * is still executed using prefetch. Executing a channel program that > + * does not specify prefetching will typically not cause an error, but a > + * warning is issued to help identify the problem if something does break. > */ > - if (!orb->cmd.pfch) > - return -EOPNOTSUPP; /* custom ratelimiting to avoid flood during boot */ (to avoid people stumbling over this) > + if (!orb->cmd.pfch && __ratelimit(&ratelimit_state)) > + dev_warn(mdev, "executing channel program with prefetch, but prefetch isn't specified"); hmm... what about "prefetching channel program even though prefetch not specified in orb"? > > INIT_LIST_HEAD(&cp->ccwchain_list); > memcpy(&cp->orb, orb, sizeof(*orb)); (...) Apart from the bikeshedding, looks sane to me; but would like more opinions.