Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp305506ybv; Wed, 5 Feb 2020 05:59:51 -0800 (PST) X-Google-Smtp-Source: APXvYqw8iMfVOA3q/CHv1jf0pq4m/JEnb6uK6374StyasrXWaADLx8eJPzM+AVOW/hTOUU55fB3h X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr26660039otp.346.1580911191218; Wed, 05 Feb 2020 05:59:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580911191; cv=none; d=google.com; s=arc-20160816; b=nx08r21cCjyq4UgnAV6CFcpSv+wGQ27n+q2aKfXsF9Q291f3dK+pBu7+gnbh5NVQjv 8ZMlPa/YocKnioAfCKIK9CoWTpFwtEWQ5xB/HT8zz+jM84znquvUtTkO06dH8XNQGK6q ZQ7Vok0VHwsyoqB3tdS1lJBW1FkkEQoRXZCsM4Sxnb5VWY2Jil3zldpwLrQO2WdMn5iT cvIXiG+kcfvJk3prtAVFopTXVH0dorVsap7hR6hnAGJIDNYPJ3GCLabSdERFmAJSbXpm N1jfro+MeOkS1yTJXCsp9EIMv996asoichooBB6cM7OAX4rPcR5Gu6rk6vX+RBiooq5c gAiw== 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=YJfMTUUUyxi1VxzyCVz1DpE8ZQQJQVENAYA2Qdsr+C4=; b=cKuzTy7mZXamSaQgjxTdj5Hlo6r16NuS1glNssf9FIj9fK6Q6Z1ojhw8kWKNPV0sxR fyex+JbiIOS84PwmdM8dd6ozagLUzZJ/6oJPyysmxE1C9uCuKTt1MKQN8oK/1ROO+VgN 0qDyMwLBc8dgrynmfAZ0mBiUl+pL7esdVtayHdjDYRul5CiJrItp8c/ynoAl/8rHmEPM toJaePhnRPmoYsItfN1p/FP2B2OoPRcmM1DZIHKidq5t7/aUqQKXD2ve1s4CyzcOn41r vmh3/HtLDOCAgqtsJTuYTd7SCEKU1wW4nkk7Ut+k81VKGnNZ4V53yKA1BFmB0+sTtW6w fQIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZgjY3C5c; 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=pass (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 v26si14286866otj.0.2020.02.05.05.59.38; Wed, 05 Feb 2020 05:59:51 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZgjY3C5c; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728018AbgBEN6q (ORCPT + 99 others); Wed, 5 Feb 2020 08:58:46 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54998 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbgBEN6p (ORCPT ); Wed, 5 Feb 2020 08:58:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580911124; 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=YJfMTUUUyxi1VxzyCVz1DpE8ZQQJQVENAYA2Qdsr+C4=; b=ZgjY3C5cNl5tbvk9EHNyaDzzXmaLKKT4BoqWnCyKOIT6riU0nwhpwjpHXfAi2xKI9bYAv+ xtfAiNSfepeU2odSsGaM7rwcCZPIXC5yWiCX5OBpb3C9TliZEoJ0XeUJnDaG8KayEOGZyX d7x9msHwKijlevSGUdXZiYDqO5dP5uw= 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-235-L5PxdEJ5PkSHPDZ0suQfBQ-1; Wed, 05 Feb 2020 08:58:41 -0500 X-MC-Unique: L5PxdEJ5PkSHPDZ0suQfBQ-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 589E12EEB; Wed, 5 Feb 2020 13:58:39 +0000 (UTC) Received: from x1.home (ovpn-116-28.phx2.redhat.com [10.3.116.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A37419C7F; Wed, 5 Feb 2020 13:58:38 +0000 (UTC) Date: Wed, 5 Feb 2020 06:58:36 -0700 From: Alex Williamson To: Christoph Hellwig Cc: kvm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, dev@dpdk.org, mtosatti@redhat.com, thomas@monjalon.net, bluca@debian.org, jerinjacobk@gmail.com, bruce.richardson@intel.com, cohuck@redhat.com Subject: Re: [RFC PATCH 0/7] vfio/pci: SR-IOV support Message-ID: <20200205065836.12308197@x1.home> In-Reply-To: <20200205070109.GA18027@infradead.org> References: <158085337582.9445.17682266437583505502.stgit@gimli.home> <20200205070109.GA18027@infradead.org> Organization: Red Hat 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, 4 Feb 2020 23:01:09 -0800 Christoph Hellwig wrote: > On Tue, Feb 04, 2020 at 04:05:34PM -0700, Alex Williamson wrote: > > We address this in a few ways in this series. First, we can use a bus > > notifier and the driver_override facility to make sure VFs are bound > > to the vfio-pci driver by default. This should eliminate the chance > > that a VF is accidentally bound and used by host drivers. We don't > > however remove the ability for a host admin to change this override. > > That is just such a bad idea. Using VFs in the host is a perfectly > valid use case that you are breaking. vfio-pci currently does not allow binding to a PF with VFs enabled and does not provide an sriov_configure callback, so it's not possible to have VFs on a vfio-pci bound PF. Therefore I'm not breaking any existing use cases. I'm also not preventing VFs from being used in the host, I only set a default driver_override value, which can be replaced if a different driver binding is desired. So I also don't see that I'm breaking a usage model here. I do stand by the idea that VFs sourced from a user owned PF should not by default be used in the host (ie. autoprobed on device add). There's a pci-pf-stub driver that can be used to create VFs on a PF if no userspace access of the PF is required. Thanks, Alex