Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3238693pxm; Mon, 28 Feb 2022 15:17:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhJL3vyJeRdw+FKOIPLZZ06d1/1x9niCcTCHRv5OBCzEmN80dY2BpnCldJ9+/6zPN5O+/L X-Received: by 2002:a05:6402:1385:b0:413:2bc6:4400 with SMTP id b5-20020a056402138500b004132bc64400mr21776807edv.94.1646090233958; Mon, 28 Feb 2022 15:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646090233; cv=none; d=google.com; s=arc-20160816; b=KjIfJ30qLjXEZW2+cYXqHZ1YgKrWmWXX2GsaOJfhMjk8grQ7ei3RSgeFAwdGve+gJN Kfe8eHbbx8ljuWeN6QBThRy95jUElC5wQmr3mg5zboN5YRQoSDYAuqf3fWYuleWdQ1bn 9TXwzocr2aYBmbMKUe6ue+Pjy7orDb3v7hEUVjc0dbIn28kll9HJj2b1CE2gKxqcn2tX b+ycX+5vqUhb4fXakwJMaj/xN4jRJ0WJqWctgFJtvbmLgBwKfa2PU+55+L5BRvK+ijKs k93OPUqr6V0PxFxAwFLDmdFc3j2goFMpc1wRgLBeNvegt03uxYw9IyEbI4svT+RBXeTk Yb0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=1LW+d0gtxqXAjakKIGWcmifEtiCoe2QekVg+4keAltg=; b=tt1JdFCwYEYSKVyzO4to7vOYmsb/z4UFA0G49MZ9RtvEIJu5XuIvFr4nT5KSiYsRS9 VekoJ8bSn8wMfVaMEgtBpR+izHB8TIepvuLTnmmbKSLWJpKDKstQwaWiMCarC1cOaO6b YzrOB4YzS9VMmJHpbfwF/ZcYAWpbhqfKSgve8JGZYyK5GdfG3JuoG5va3z159gejJWKP CZqqZR7EgtHTcwisrYmy/uG4jBuzllNR3eVFsz5IX4x27jB6GhjacdzNsZS5olBG5enX nbUy9AK02KSRvnUik8K080eK4C5fEb02ddhRjKirfYHjGIuf+mNvdla6y5qkVGwREiMk iR4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZQcDhle+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a50e608000000b0041379425f80si6832046edm.325.2022.02.28.15.16.51; Mon, 28 Feb 2022 15:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZQcDhle+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231270AbiB1WHT (ORCPT + 99 others); Mon, 28 Feb 2022 17:07:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230503AbiB1WHO (ORCPT ); Mon, 28 Feb 2022 17:07:14 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 259C2C4E3D for ; Mon, 28 Feb 2022 14:06:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646085994; 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=1LW+d0gtxqXAjakKIGWcmifEtiCoe2QekVg+4keAltg=; b=ZQcDhle+kSZWyEdihfyKJCikmiCc1QREqsbFhf3Zh7JYqjNREv58TZ+ymnwvTuyzVHNYkP jagKGEnBXbOyiH9uOKxftWyZr6gCclWsa2NeEbh2zoPuOjO2/5N4HbhmhuyjsCKoYmPsXx TIB3oJwVZ+u2/ReGsFud8TSawgUN0g8= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-601-YVrRT8KNMwSW6nt-Lhtykw-1; Mon, 28 Feb 2022 17:06:32 -0500 X-MC-Unique: YVrRT8KNMwSW6nt-Lhtykw-1 Received: by mail-ot1-f69.google.com with SMTP id 38-20020a9d0829000000b005afe328b01dso5634530oty.16 for ; Mon, 28 Feb 2022 14:06:32 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=1LW+d0gtxqXAjakKIGWcmifEtiCoe2QekVg+4keAltg=; b=rd7sucvpYBrCqgEcjfDrPCCubft8Gps3Ow15RdRsI/Ecr3WQNR9fipbkKmw2m47R33 IhlvcXf1Artgw/Cr/VeB+FtPYMtmGUbikl82R/4u1Bj33lThHsAVZ4wJerdxj2Elsdzn QccmxLmrBghakYwWqGv2UmkGUNebtQAvVKjNg6PzIM0TV5uAiIXpHn1vMfOmIm9rDDJ0 GtkiDzrxLfVrKNCiK8+G5PFoj+FkB9u+yjJYJqwgCgr1SnIG94Hv7UgKCrpT6csURXPW hgqNhVZpKXpJ+tDsEBbK5bXYUTq/KH6yHcepJJW4O3batMtMTuUQr6KLAykrJrVJ2xTR 5kyg== X-Gm-Message-State: AOAM530S7diaeVHCMPTsNPDdPqn2SX8cd4TP1nXu/fHFmITCwa6cRnkd QrKeH+WCIRT1kc3EgTRRAl9U3h5PKj3Uu4b3iaYeXI7xLny1BM1h/Lj1uy6xP2SawB9g/VjlcF5 DlwH9fzOUKgTCY0l/htDJgALi X-Received: by 2002:a05:6830:314d:b0:5af:fecc:538e with SMTP id c13-20020a056830314d00b005affecc538emr5635058ots.348.1646085991353; Mon, 28 Feb 2022 14:06:31 -0800 (PST) X-Received: by 2002:a05:6830:314d:b0:5af:fecc:538e with SMTP id c13-20020a056830314d00b005affecc538emr5635030ots.348.1646085990790; Mon, 28 Feb 2022 14:06:30 -0800 (PST) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id bd14-20020a056808220e00b002d53f900b9csm7017463oib.30.2022.02.28.14.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 14:06:30 -0800 (PST) Date: Mon, 28 Feb 2022 15:06:28 -0700 From: Alex Williamson To: Lu Baolu Cc: Greg Kroah-Hartman , Joerg Roedel , Bjorn Helgaas , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Dan Williams , rafael@kernel.org, Diana Craciun , Cornelia Huck , Eric Auger , Liu Yi L , Jacob jun Pan , Chaitanya Kulkarni , Stuart Yoder , Laurentiu Tudor , Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , Li Yang , Dmitry Osipenko , iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 09/11] vfio: Delete the unbound_list Message-ID: <20220228150628.2c0077f4.alex.williamson@redhat.com> In-Reply-To: <20220228005056.599595-10-baolu.lu@linux.intel.com> References: <20220228005056.599595-1-baolu.lu@linux.intel.com> <20220228005056.599595-10-baolu.lu@linux.intel.com> 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 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Feb 2022 08:50:54 +0800 Lu Baolu wrote: > From: Jason Gunthorpe > > commit 60720a0fc646 ("vfio: Add device tracking during unbind") added the > unbound list to plug a problem with KVM where KVM_DEV_VFIO_GROUP_DEL > relied on vfio_group_get_external_user() succeeding to return the > vfio_group from a group file descriptor. The unbound list allowed > vfio_group_get_external_user() to continue to succeed in edge cases. > > However commit 5d6dee80a1e9 ("vfio: New external user group/file match") > deleted the call to vfio_group_get_external_user() during > KVM_DEV_VFIO_GROUP_DEL. Instead vfio_external_group_match_file() is used > to directly match the file descriptor to the group pointer. > > This in turn avoids the call down to vfio_dev_viable() during > KVM_DEV_VFIO_GROUP_DEL and also avoids the trouble the first commit was > trying to fix. > > There are no other users of vfio_dev_viable() that care about the time > after vfio_unregister_group_dev() returns, so simply delete the > unbound_list entirely. > > Reviewed-by: Chaitanya Kulkarni > Signed-off-by: Jason Gunthorpe > Signed-off-by: Lu Baolu > --- > drivers/vfio/vfio.c | 74 ++------------------------------------------- > 1 file changed, 2 insertions(+), 72 deletions(-) Acked-by: Alex Williamson