From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0753A31A9A for ; Thu, 28 Sep 2023 22:21:42 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3219C1BC for ; Thu, 28 Sep 2023 15:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695939700; 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=VYqIaFDftvj8+TDcTZgaXgu9cICTLPBd1GmPz49S0qk=; b=ABakTvh+Sb7ohiNbJUAUE+lcOUBdsAskCC2flRA2/pz9KXcsSO8oSqE9F8VCHUL8TMLT2B WxjNjNEToipNxKJ2NLkf+5MVoGsN+LW0h/qzM2p6Kz3DtDimxAYX3wg+RBTHNA6LkmgSaj 1S5AtBMwXCH4mgoHwuXs1GdBDiMqFfo= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-464-KVc3APsPORmgaO44iPT_EA-1; Thu, 28 Sep 2023 18:21:39 -0400 X-MC-Unique: KVc3APsPORmgaO44iPT_EA-1 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-7a2576bdcb7so182513839f.0 for ; Thu, 28 Sep 2023 15:21:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695939698; x=1696544498; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VYqIaFDftvj8+TDcTZgaXgu9cICTLPBd1GmPz49S0qk=; b=XU5ql4ps5YWRFkvntnq7tE+jXTHBkjCvx2TBEJDYyv+s4Y3dYXPgNCwWU3tQVjA4UJ AiSsPzejvaEHAthLofAt5fP+9o+/hdqjvtoJlCHTHXWE1UjGXKOr7H8ygTRkNMYShYz/ XLB0Stxq7JgVfb5aRI6yWN6w5SP4/KypLiQhwJqu2RKEP/dJ3zXQ1yOIhW81NWT1HBuO 8T7vfLiWpxDPTSmciuZVuWxNluXlrzTCR9cezBxAs2RMybI4NPNb+a/UM2A8IWCHiDkB 99CosSwVnV+iH7doJ7+oMrC3PlbTgjxUjHG5WDB3RnbWptk/rDRnlPdetNGU+EFBn/Op GmLw== X-Gm-Message-State: AOJu0YyXufW0jf2BbCeMS4HJFHjLXmd4flTJC6e05OIDQlGcvDhIDwXg LAWz+0ZBVnl9Tk6O4tAhxrDfVsJzn4+mXWMdvNCXwK0I7G2o6QNSWYx1uvdPrqOXhyTs55bPONZ hK4vXxcQsbX80K9xe5yzWC+fxbKX6CQ== X-Received: by 2002:a05:6602:2211:b0:798:3cb5:ad30 with SMTP id n17-20020a056602221100b007983cb5ad30mr2909937ion.7.1695939698500; Thu, 28 Sep 2023 15:21:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv0LRR9DkFI1OYy1PoOT1i3eAWQj2VngBzVVO4xeK3kF6WDlUiAdkJKTL/cdHqWL0xs+JJYA== X-Received: by 2002:a05:6602:2211:b0:798:3cb5:ad30 with SMTP id n17-20020a056602221100b007983cb5ad30mr2909893ion.7.1695939698157; Thu, 28 Sep 2023 15:21:38 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id t23-20020a02c497000000b0042b10d42c90sm4610172jam.113.2023.09.28.15.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:21:37 -0700 (PDT) Date: Thu, 28 Sep 2023 16:21:06 -0600 From: Alex Williamson 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 , 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 03/26] virt: Declare and define vfio_file_set_kvm() iff CONFIG_KVM is enabled Message-ID: <20230928162106.0b0de53c.alex.williamson@redhat.com> In-Reply-To: <20230916003118.2540661-4-seanjc@google.com> References: <20230916003118.2540661-1-seanjc@google.com> <20230916003118.2540661-4-seanjc@google.com> Organization: Red Hat Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Fri, 15 Sep 2023 17:30:55 -0700 Sean Christopherson wrote: > Hide vfio_file_set_kvm() and its unique helpers if KVM is not enabled, > nothing else in the kernel (or out of the kernel) should be using a > KVM specific helper. > > Signed-off-by: Sean Christopherson > --- > drivers/vfio/vfio_main.c | 2 +- > include/linux/vfio.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) As Jason noted, s/virt/vfio/ in title. Reviewed-by: Alex Williamson > diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c > index 6368eed7b7b2..124cc88966a7 100644 > --- a/drivers/vfio/vfio_main.c > +++ b/drivers/vfio/vfio_main.c > @@ -1352,7 +1352,6 @@ void vfio_device_put_kvm(struct vfio_device *device) > clear: > device->kvm = NULL; > } > -#endif > > static void vfio_device_file_set_kvm(struct file *file, struct kvm *kvm) > { > @@ -1388,6 +1387,7 @@ void vfio_file_set_kvm(struct file *file, struct kvm *kvm) > vfio_device_file_set_kvm(file, kvm); > } > EXPORT_SYMBOL_GPL(vfio_file_set_kvm); > +#endif > > /* > * Sub-module support > diff --git a/include/linux/vfio.h b/include/linux/vfio.h > index 454e9295970c..e80955de266c 100644 > --- a/include/linux/vfio.h > +++ b/include/linux/vfio.h > @@ -311,7 +311,9 @@ static inline bool vfio_file_has_dev(struct file *file, struct vfio_device *devi > #endif > bool vfio_file_is_valid(struct file *file); > bool vfio_file_enforced_coherent(struct file *file); > +#if IS_ENABLED(CONFIG_KVM) > void vfio_file_set_kvm(struct file *file, struct kvm *kvm); > +#endif > > #define VFIO_PIN_PAGES_MAX_ENTRIES (PAGE_SIZE/sizeof(unsigned long)) >