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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5E45DE743C9 for ; Thu, 28 Sep 2023 22:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N7WqvD1QHo6OmxuHgV5XMdwMcyyruKzMCAuk0AhUP3E=; b=CEtp6ahRoXPfHm fWZb/0JMIqUGPQ8OOuAjKBXnqYQoMwS0uK1sapPFKDvje2uBXVvglDKtsdpVBZKxBe9OMMFXzO8hI OBIXmo7sL24XMAgyFGHzfa2OREi/JJWJZDZuMjEb08ql0GWKHNSY17KjeKwNcvYheMQ5PbqEl6WlG fzVd4V84uBm9+EigqRbW+6HSKRNRhyRUN086DnuScVGr2yS+hcmETplyh0ytpgoxXc8sc4TwEfPmq rUgsDz3lvNEOWy3r92yBMTEfwD2V+Ooo6A5aJFgnuXjq5nTjN96opkkC81vH82arFQYwE8IiOZaYQ zJd1zcgbgXRA7oJmseUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlzPA-006maO-0i; Thu, 28 Sep 2023 22:22:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlzO9-006m5B-2F for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2023 22:21:45 +0000 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-21-Xm9j2QGgM--s8K2RCvUnDg-1; Thu, 28 Sep 2023 18:21:39 -0400 X-MC-Unique: Xm9j2QGgM--s8K2RCvUnDg-1 Received: by mail-io1-f72.google.com with SMTP id ca18e2360f4ac-79f9edb0086so1530960939f.2 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=uUq/H/RKBG/48A0xDBhzM/LGS5wJUb3bSOVfJUKq6528kRqMU2PHTRIfYEhhDUtI6s JKOohWB22n736ahIiuWfuHzoFhe1m5rqPbE1S9UIh1amsoFhqfNck7r5+7T5jjutBB7P vB30zTarFqSCtZO3R457u3Y2o0/G1aE7vlZscMqHXhH5Zoia/cFOlsXxpy3/wUf0liUY BEuzgcbzxmIgcQoeNkvVtEuT/+QUYHDvODFIvDLPpcYEI3MG2MTxioUIFRkZjC8yZ21n PYX3r6+enYkqet7cJz/x/XhcJmPWDWJsodkL1t74SHBtw7FYDx3/0sh6oFGs/5gDMqXg SZcg== X-Gm-Message-State: AOJu0YzUSg8GOXoYWNvmzZl3L6VUQulS4lFKmvhzWp6H8jyCTxytSEVn xmQkIOq6J6Lpbr+luExkkhU1QaDnbiNgymG4XzRv0kRkAPdfxgp6guzxi7lLiwr0btjqLVdsBBU swgUsN3McVftcLCoNqp51MHl8xz88O+GzRzo= X-Received: by 2002:a05:6602:2211:b0:798:3cb5:ad30 with SMTP id n17-20020a056602221100b007983cb5ad30mr2909936ion.7.1695939698498; 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 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230928_152141_804952_C28E8781 X-CRM114-Status: GOOD ( 18.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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)) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel