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 01140C433EF for ; Mon, 28 Feb 2022 22:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbiB1WHY (ORCPT ); Mon, 28 Feb 2022 17:07:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231332AbiB1WHH (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 05EDA14CCB1 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=1646085987; 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=GUELIsv7eLkF6c8DNHomRjBJV7k7MidZBhPXOvc5BLK9LalYdAaziwiV0PmbGh6z/N4tqe IZR9HM1BiPmSvR0Fjg5qyj4JoWbUp+z7dYbfSr33Pl5rVJn5phc88Xx2K4lzwA0ZXNRpiL MZWLC3dovLIs3i44KZ8yiWX5pBTauRA= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-190-9RUOAEtnMr2J3ko_0l2oRg-1; Mon, 28 Feb 2022 17:06:25 -0500 X-MC-Unique: 9RUOAEtnMr2J3ko_0l2oRg-1 Received: by mail-oo1-f72.google.com with SMTP id r18-20020a056820039200b0031d6f9170eeso3054279ooj.6 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=uJhmzt9AnN4RltMhLi4e7MrSYdGsY9lxJdneQesE6sfOlY5tw0+8+BkuaVC3wXfWg5 bkpqqL19fu3Pqct2JIy5/2Z3O8XXjj2ZQnY6WtGa7u/i/jsC0251XviR0mgI2nWJJATJ VaAQ22kVrS63DNm6dGuz8vnp2J5+bmI3YddiRdbhayzl8C/TYOjNedAjx5S9asTGmVzG J3zXLmtZcoyLfrZSYRzUin/UGymgou/Aq7EjBQxGU9d0rj3MBYJteiH7UFPZb92VF7el AxIbWWIr2uRaOMlUMvOsdcngy4qyf8sLu1a8D3Ud8V4kINHsJY9HbKGaX85A3HoVJ5Lv UR0w== X-Gm-Message-State: AOAM530mxGeAzpies0Vhq72HxDBSxHK1R/AECalYtibW6o/Qa8i5mYAB awGlHXDg4Pe8+NyQPiXNZ9gFoBgstYcGyN7EL34OttCX9gYfZU2H0PLuwlF1xmCBbayQbE4TDDl 4LbqJQyXcqhF6ohcsaMiJEcNR X-Received: by 2002:a05:6808:1148:b0:2d5:2333:bbb1 with SMTP id u8-20020a056808114800b002d52333bbb1mr10736852oiu.130.1646085984662; 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-kernel@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