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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8696C433EF for ; Wed, 13 Apr 2022 16:07:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C70610E3A8; Wed, 13 Apr 2022 16:07:05 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by gabe.freedesktop.org (Postfix) with ESMTPS id E65D510E3A8; Wed, 13 Apr 2022 16:07:03 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 2166F68BEB; Wed, 13 Apr 2022 18:07:01 +0200 (CEST) Date: Wed, 13 Apr 2022 18:07:00 +0200 From: Christoph Hellwig To: Jason Gunthorpe Message-ID: <20220413160700.GB29631@lst.de> References: <0-v1-a8faf768d202+125dd-vfio_mdev_no_group_jgg@nvidia.com> <9-v1-a8faf768d202+125dd-vfio_mdev_no_group_jgg@nvidia.com> <20220413061105.GA32701@lst.de> <20220413140305.GD368031@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220413140305.GD368031@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: [Intel-gfx] [PATCH 9/9] vfio: Remove calls to vfio_group_add_container_user() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, linux-doc@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, Kirti Wankhede , Vineeth Vijayan , Alexander Gordeev , Christoph Hellwig , linux-s390@vger.kernel.org, "Liu, Yi L" , Matthew Rosato , Jonathan Corbet , Halil Pasic , Christian Borntraeger , intel-gfx@lists.freedesktop.org, Jason Herne , Eric Farman , Vasily Gorbik , Heiko Carstens , Harald Freudenberger , Rodrigo Vivi , intel-gvt-dev@lists.freedesktop.org, Tony Krowiak , Cornelia Huck , Peter Oberparleiter , Sven Schnelle Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, Apr 13, 2022 at 11:03:05AM -0300, Jason Gunthorpe wrote: > On Wed, Apr 13, 2022 at 08:11:05AM +0200, Christoph Hellwig wrote: > > On Tue, Apr 12, 2022 at 12:53:36PM -0300, Jason Gunthorpe wrote: > > > + if (WARN_ON(!READ_ONCE(vdev->open_count))) > > > + return -EINVAL; > > > > I think all the WARN_ON()s in this patch need to be WARN_ON_ONCE, > > otherwise there will be too many backtraces to be useful if a driver > > ever gets the API wrong. > > Sure, I added a wrapper to make that have less overhead and merged it > with the other 'driver is calling this correctly' checks: Looks good: Reviewed-by: Christoph Hellwig