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 B3E05C433F5 for ; Fri, 15 Apr 2022 14:36:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354584AbiDOOiz (ORCPT ); Fri, 15 Apr 2022 10:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354522AbiDOOix (ORCPT ); Fri, 15 Apr 2022 10:38:53 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EBE548303 for ; Fri, 15 Apr 2022 07:36:25 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id E338A68AFE; Fri, 15 Apr 2022 16:36:21 +0200 (CEST) Date: Fri, 15 Apr 2022 16:36:21 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , Alex Williamson , Cornelia Huck , kvm@vger.kernel.org, Paolo Bonzini , Eric Auger , Yi Liu Subject: Re: [PATCH 04/10] vfio: Use a struct of function pointers instead of a many symbol_get()'s Message-ID: <20220415143621.GA1958@lst.de> References: <0-v1-33906a626da1+16b0-vfio_kvm_no_group_jgg@nvidia.com> <4-v1-33906a626da1+16b0-vfio_kvm_no_group_jgg@nvidia.com> <20220415044533.GA22209@lst.de> <20220415121301.GH2120790@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415121301.GH2120790@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Apr 15, 2022 at 09:13:01AM -0300, Jason Gunthorpe wrote: > > So I got anoyed at this as well a while ago and I still think this > > is the wrong way around. > > What I plan to do in future is to have differnt ops returned depending > on if the file is a struct vfio_group or a struct vfio_device, so it > is not entirely pointless like this. Uh, I think that is a rather ugly interface. Why would kvm pass in FDs to both into the same interface. > > > I'd much rather EXPORT_SYMBOL_GPL kvm_register_device_ops and > > just let kvm_vfio_ops live in a module than all the symbol_get > > crazyness. We'll need to be careful to deal with unload races > > or just not allow unloading, though. > > This is certainly more complicated - especially considering module > unload - than a single symbol_get(). How do you see the benefit? Because that is the sensible layering - kvm already has an abstract interface for emulated devices. So instead of doing symbol_get magic of some kind we should leverage it. But I can see how that is something you might not want to do for this series. So maybe stick to the individual symbol_gets for now and I'll send a separate series to clean that up? Especially as I have a half-finished series for that from a while ago anyway. > > Jason ---end quoted text---