From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8407BC433FE for ; Wed, 22 Sep 2021 20:10:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 708906120E for ; Wed, 22 Sep 2021 20:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237419AbhIVUMM (ORCPT ); Wed, 22 Sep 2021 16:12:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56578 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237364AbhIVUML (ORCPT ); Wed, 22 Sep 2021 16:12:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632341441; 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=LVDSHQbpVe8JTY8isblrL8p142CPVwt8+X+MPr7eWPw=; b=a233ldhimVDIrls1bZs8+PfFFGWYCGNYZ4CfC0NXQcJty1QiPd0vpUzgKEnlG8O0mA/qEX FvtMxNi3GoN+USyDGNIEwOjzpQ8uEkLtFYkVLucsV7feU+sEEL2I8+RutpvS4r30nUg5m8 eNG9RVvSPK7DTCvoozKZB988UmRE2Ro= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-nd62RlVEMBOSpShppZZGMw-1; Wed, 22 Sep 2021 16:10:40 -0400 X-MC-Unique: nd62RlVEMBOSpShppZZGMw-1 Received: by mail-oi1-f199.google.com with SMTP id y185-20020acaafc2000000b0027359453ad4so2470146oie.6 for ; Wed, 22 Sep 2021 13:10:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=LVDSHQbpVe8JTY8isblrL8p142CPVwt8+X+MPr7eWPw=; b=nNAS/tzMD+573hcIaHesQWDgg4Rf+8bpT1mD5pvSQ9zGvpQvRq8PS8zWtQami5AokO xXlKxd1DEWWOVh9upSHnXGxN0zILKh61gquNAnNg1AUW8RDw4vitODtZe8Aa4gA44p1e fQjALny0OSI1HmGpfwvijcn6IpHVtRHhZmrn5C2qyvbHVljO5s36tbV9ZgLiXLlN2PXB ZQ61jCHDSyZ2EGMVTI695U43V6sGy9N06+8T2I93doQPuBaLCwfnRyfGLv86DN2F8C6E TWi4wr4hvCFn+pOAlJS5cB+LGWG5XgwiWDt6V4TXDArHDxlE+ERjmGQADsCxrKz4s6cP ziwA== X-Gm-Message-State: AOAM533mtkNmAQquMlDpV85fR85PHmerbK7V/Zu1UeDhrShauJTETmcw yT07Aa07w198jg+qXbnNqvnxJCjDRYxz87wCFNlz3SdGJkZdew4pi6gF3iHk0gVzH9tkJJMDFt9 QPuJwwmAMgZNI X-Received: by 2002:aca:5f09:: with SMTP id t9mr785747oib.157.1632341439238; Wed, 22 Sep 2021 13:10:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsexkS3ssuL6wF9vSWKPex4M0QKWRz+hAFF7uOcJjumY+ZptpBRjRLEImjoapaxD27rGKTYw== X-Received: by 2002:aca:5f09:: with SMTP id t9mr785712oib.157.1632341438954; Wed, 22 Sep 2021 13:10:38 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id a15sm720852otq.13.2021.09.22.13.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 13:10:38 -0700 (PDT) Date: Wed, 22 Sep 2021 14:10:36 -0600 From: Alex Williamson To: Jason Gunthorpe Cc: "Tian, Kevin" , "Liu, Yi L" , "hch@lst.de" , "jasowang@redhat.com" , "joro@8bytes.org" , "jean-philippe@linaro.org" , "parav@mellanox.com" , "lkml@metux.net" , "pbonzini@redhat.com" , "lushenming@huawei.com" , "eric.auger@redhat.com" , "corbet@lwn.net" , "Raj, Ashok" , "yi.l.liu@linux.intel.com" , "Tian, Jun J" , "Wu, Hao" , "Jiang, Dave" , "jacob.jun.pan@linux.intel.com" , "kwankhede@nvidia.com" , "robin.murphy@arm.com" , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "dwmw2@infradead.org" , "linux-kernel@vger.kernel.org" , "baolu.lu@linux.intel.com" , "david@gibson.dropbear.id.au" , "nicolinc@nvidia.com" Subject: Re: [RFC 03/20] vfio: Add vfio_[un]register_device() Message-ID: <20210922141036.5cd46b2b.alex.williamson@redhat.com> In-Reply-To: <20210922122252.GG327412@nvidia.com> References: <20210919063848.1476776-1-yi.l.liu@intel.com> <20210919063848.1476776-4-yi.l.liu@intel.com> <20210921160108.GO327412@nvidia.com> <20210922005337.GC327412@nvidia.com> <20210922122252.GG327412@nvidia.com> Organization: Red Hat X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 22 Sep 2021 09:22:52 -0300 Jason Gunthorpe wrote: > On Wed, Sep 22, 2021 at 09:23:34AM +0000, Tian, Kevin wrote: > > > > Providing an ioctl to bind to a normal VFIO container or group might > > > allow a reasonable fallback in userspace.. > > > > I didn't get this point though. An error in binding already allows the > > user to fall back to the group path. Why do we need introduce another > > ioctl to explicitly bind to container via the nongroup interface? > > New userspace still needs a fallback path if it hits the 'try and > fail'. Keeping the device FD open and just using a different ioctl to > bind to a container/group FD, which new userspace can then obtain as a > fallback, might be OK. > > Hard to see without going through the qemu parts, so maybe just keep > it in mind If we assume that the container/group/device interface is essentially deprecated once we have iommufd, it doesn't make a lot of sense to me to tack on a container/device interface just so userspace can avoid reverting to the fully legacy interface. But why would we create vfio device interface files at all if they can't work? I'm not really on board with creating a try-and-fail interface for a mechanism that cannot work for a given device. The existence of the device interface should indicate that it's supported. Thanks, Alex