Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp394148rdb; Mon, 18 Sep 2023 20:30:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3wUv52LSB6AqYeKVhi6Idbkc9Uu2lHknGDUe2ilVWaJUCLSfyq6wdc6Fz+LjOWgoP+FQn X-Received: by 2002:a05:620a:4405:b0:772:6400:f111 with SMTP id v5-20020a05620a440500b007726400f111mr14019188qkp.47.1695094220790; Mon, 18 Sep 2023 20:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695094220; cv=none; d=google.com; s=arc-20160816; b=M39Ygt0KdEgIgmWGXQPYp4jHPiR4Coa1nuBycaFwB/Ns1WbLasbwS6iBl3A0sjHual 1ay2pjMBjZIAszKd/TsUSytYtyy+LiKfg90GzsGMWw0lp3bUpl5ODTosAo+ipmvY1y1g 6uVF9Pkcwe9u/H09+Jxjr7O5ej8W0wcJA/MLzcZE9ox25ZqEEB7Z6hVDUZUNXnglxxM2 wWj1/+NrT6fOUd7d4hM4Xz6YTIn2PSrrT3ay8tEFrsX2pIHrYybRyA0/jB1jd9mgG6CQ fyPP6beu3DzQ7PliBP1DgZVR56jDp6hwwm+AE1SQhKKYNXLF//6iCPqGX6mK2iNxQBkk W93Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9iwt12QdmH2nPtcjR0iEq1G+1D18erLjJ1cQj58qe4I=; fh=LvR0iFQNUCFuLf0e0dfpbwu/ZRO+ihf5gBz7bBaQp/0=; b=sajOGhz7wj1GGwROmk03OG1/TQL06fgDPgH/R8ksFBazGksJ0QRhFDnoeiR3OqaMJS ZTgB4rpU42eaCwNFsfWCsg+cVb0HqAUPDRwTO+hFMJjVK1rQy0Z+8Hy23+n/a2JO4IAu V01v0CKW6NeThEzNuNzEc8W6MV9kvT8HISSeXq9vLB69egD2QsDCyQ2A4NlUnZNWvYml Aqmv0W94DcJLEKJc6fuV8qDH70dxMGxMq5tCzXIL1t9W51IpR+zSpetIZ+X3cXhSQ5h4 1/XktzZlyBYvydKM1SSBLOgH1Ufo/mi1aFIVE45OHBiE0VrFDprgsWrLIcbfYJ9WWhmz Y5EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="Q/2lfiKY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id w3-20020a63f503000000b0055b43079640si8958291pgh.707.2023.09.18.20.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 20:30:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="Q/2lfiKY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 01C7F81C9014; Mon, 18 Sep 2023 08:23:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238837AbjIRPXV (ORCPT + 99 others); Mon, 18 Sep 2023 11:23:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239938AbjIRPXT (ORCPT ); Mon, 18 Sep 2023 11:23:19 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E460173E for ; Mon, 18 Sep 2023 08:21:38 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-76f08e302a1so302429885a.1 for ; Mon, 18 Sep 2023 08:21:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1695050472; x=1695655272; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9iwt12QdmH2nPtcjR0iEq1G+1D18erLjJ1cQj58qe4I=; b=Q/2lfiKYNE/5K44PTGLhus4LlnlDi7yhqp/bgjYuFQ0srmDvs9Vtf+YrDz+IMsI1HW 8WvtWWsMgjFnPgsBGQaoAkFmfzAva1/GK+AfQarXQ6qfMQV0DGj8+Gy8CfKOOwJovRTu k8biRM6eQ1SdamNDRhZcNmwefP1gxTQZAevYCGXlMHDNI02s5j/dcovffbbAJuSz5x79 pvDtijN5fAs8mvNBahRLnCvozpxm7uSEkD1oz0Bb1GySdXnLQq9/IXTZRMsUXFfq74BR pKjFQ6T951q3tMjM6MNkEuZBLWQ3Yu/qzjivb8N9rDCwpFzpjjj9OFyIEvF2qF8qG2yP Fw0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695050472; x=1695655272; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9iwt12QdmH2nPtcjR0iEq1G+1D18erLjJ1cQj58qe4I=; b=rcrvDNle1A05hY3ur/YGWgg1NrgPq6cMgcHdO7esvMIZdeEG/gRFO7fgFlZoWWaljq OnNqndOrZIKyDNqGmF03MCzQjmW+VR0GXw/94dknr7NgTK3aTj/bt2IV38CajCr9gUGt bNotb9YE51TdGvNYmfGKO5Q2XEvlKecSpjcYVpcRNXUK8mqc8qF9nCfZa5KMZxHXS+hn XOmgHPfykjcL7uB4hiLO9bcvHdKvCRFEhy57bdC/PrpjKpHb0dY41tyRSHM2r3hW0J2L /ckZ0SZ0RVpgKuZryQl3UpHA7v1u9ifUSvqWhhVJMv+wFrpExQkUZMQ1smrn4ELq3y3v xPTg== X-Gm-Message-State: AOJu0YzlBsYaxfr8YCAREJB4cOYLZmCYHs9fGKKmKg/aB0cgpuqnYykq 5ccqCz7JFzjWsCKlSQUzSbu7Lg== X-Received: by 2002:a05:620a:31a8:b0:76d:a110:856d with SMTP id bi40-20020a05620a31a800b0076da110856dmr11089993qkb.0.1695050471902; Mon, 18 Sep 2023 08:21:11 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-26-201.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.26.201]) by smtp.gmail.com with ESMTPSA id i20-20020a05620a145400b0076f18be9a64sm3220186qkl.81.2023.09.18.08.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 08:21:11 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1qiG3i-0005PK-IY; Mon, 18 Sep 2023 12:21:10 -0300 Date: Mon, 18 Sep 2023 12:21:10 -0300 From: Jason Gunthorpe To: Sean Christopherson Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Peter Zijlstra , Arnaldo Carvalho de Melo , Paolo Bonzini , Tony Krowiak , Halil Pasic , Jason Herne , Harald Freudenberger , Alex Williamson , Andy Lutomirski , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Anish Ghulati , Venkatesh Srinivas , Andrew Thornton Subject: Re: [PATCH 05/26] vfio: KVM: Pass get/put helpers from KVM to VFIO, don't do circular lookup Message-ID: <20230918152110.GI13795@ziepe.ca> References: <20230916003118.2540661-1-seanjc@google.com> <20230916003118.2540661-6-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230916003118.2540661-6-seanjc@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:23:46 -0700 (PDT) On Fri, Sep 15, 2023 at 05:30:57PM -0700, Sean Christopherson wrote: > Explicitly pass KVM's get/put helpers to VFIO when attaching a VM to > VFIO instead of having VFIO do a symbol lookup back into KVM. Having both > KVM and VFIO do symbol lookups increases the overall complexity and places > an unnecessary dependency on KVM (from VFIO) without adding any value. > > Signed-off-by: Sean Christopherson > --- > drivers/vfio/vfio.h | 2 ++ > drivers/vfio/vfio_main.c | 74 +++++++++++++++++++--------------------- > include/linux/vfio.h | 4 ++- > virt/kvm/vfio.c | 9 +++-- > 4 files changed, 47 insertions(+), 42 deletions(-) I don't mind this, but Christoph had disliked my prior attempt to do this with function pointers.. The get can be inlined, IIRC, what about putting a pointer to the put inside the kvm struct? The the normal kvm get/put don't have to exported symbols at all? Jason