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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E779FC4332F for ; Mon, 28 Feb 2022 22:06:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229601AbiB1WHV (ORCPT ); Mon, 28 Feb 2022 17:07:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbiB1WHH (ORCPT ); Mon, 28 Feb 2022 17:07:07 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B2E014CCAB for ; Mon, 28 Feb 2022 14:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646085986; 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=kSd2olf1jnjo/HsSgbCsJs5j16VEb70bfQ7PmeMY2VY=; b=X/fORx8DSqlRSB8Kj0AT7WQ4mIydJNZ8yGnDnfTiiCILfmMY4YTVyQqc/KTWk20cu3Lp05 gcqNApxHkHOb0nBVBbdJ+TvApXevCtXuBdMuenLi0tThipEY1iZnmcHFajZ9sr/zCf9ctf 7lkPLi5sMG4Gt3kdeSixnT7ksu0Yj5E= Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-IpVh4rgKOMutsfWkFekeDg-1; Mon, 28 Feb 2022 17:06:25 -0500 X-MC-Unique: IpVh4rgKOMutsfWkFekeDg-1 Received: by mail-oi1-f197.google.com with SMTP id s22-20020a056808209600b002d4d6c58670so6269543oiw.18 for ; Mon, 28 Feb 2022 14:06:25 -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=kSd2olf1jnjo/HsSgbCsJs5j16VEb70bfQ7PmeMY2VY=; b=RYkl4ekjECLHTs3LXGVjL6W+ZxoO7VZpF5T3JZNxANSFJmkMAX0XnTdoU6YMW/00yf qrondCMASV01/8WoX0oLb8QvLV2lOzInIYlZCJt22j+HWumSJe6oowcDUdkn1kitmxQk K85w6CtcwWHZ/V143f41K0wAu/kWyAsPJHIUP+Lk3HlvNeq37y/hq8FWFdPfNOdjVNt/ NbMiG/k83bAtfz8tj/OTbF67xkLiOYgG0UcMy1c6fbfBAxUnjEabizOgfxqJCb7x5JXx yzaN01jQ1AgXPiei7vYyla27K7AHBiYutWaJaZRazOsISZvq54D8PbkCFUbXMURnTpFd Exqw== X-Gm-Message-State: AOAM531BiFN9eoF0vT+h8ZDEC/EdoHNgZogBgIhwGZizew5WBimn2OSm AACAYzhYK3HawCTY6kvg8Zvnto9eYuT+bZ4ojOwR34qo3CnlSj3hb6olAQ6wiQOxr3whagb/Evw SsFLWslVam1StrSqRwV9Z X-Received: by 2002:a05:6808:1148:b0:2d5:2333:bbb1 with SMTP id u8-20020a056808114800b002d52333bbb1mr10736877oiu.130.1646085984696; Mon, 28 Feb 2022 14:06:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXyd5cLZVXv21R215ahGVE59QoOxgoKUS9B2IAT3b2Nrgqe4ENaiagVjBUsTuHIIBNYSayzQ== X-Received: by 2002:a05:6808:1148:b0:2d5:2333:bbb1 with SMTP id u8-20020a056808114800b002d52333bbb1mr10736822oiu.130.1646085984239; Mon, 28 Feb 2022 14:06:24 -0800 (PST) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id i47-20020a9d172f000000b005aed7ea7b44sm5393010ota.73.2022.02.28.14.06.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 14:06:23 -0800 (PST) Date: Mon, 28 Feb 2022 15:06:21 -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 08/11] vfio: Remove use of vfio_group_viable() Message-ID: <20220228150621.5984595b.alex.williamson@redhat.com> In-Reply-To: <20220228005056.599595-9-baolu.lu@linux.intel.com> References: <20220228005056.599595-1-baolu.lu@linux.intel.com> <20220228005056.599595-9-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 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, 28 Feb 2022 08:50:53 +0800 Lu Baolu wrote: > As DMA ownership is claimed for the iommu group when a VFIO group is > added to a VFIO container, the VFIO group viability is guaranteed as long > as group->container_users > 0. Remove those unnecessary group viability > checks which are only hit when group->container_users is not zero. > > The only remaining reference is in GROUP_GET_STATUS, which could be called > at any time when group fd is valid. Here we just replace the > vfio_group_viable() by directly calling IOMMU core to get viability status. > > Signed-off-by: Lu Baolu > Reviewed-by: Jason Gunthorpe > --- > drivers/vfio/vfio.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) Acked-by: Alex Williamson