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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 BF07AE743C8 for ; Thu, 28 Sep 2023 22:25:02 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ABakTvh+; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=P/J1GSJd; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RxShs3PZqz3dGH for ; Fri, 29 Sep 2023 08:25:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ABakTvh+; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=P/J1GSJd; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=alex.williamson@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RxSd34c9Jz3c8x for ; Fri, 29 Sep 2023 08:21:43 +1000 (AEST) 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= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695939701; 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=P/J1GSJdGdP+wYekWor9SaPZNYjnV+SDxw2YnSPeHVnIOUww/2MeAXS+7n0ni4X1IdAEM1 rB+K80h0xf06LxCM5yfD0RQPUhyZfDWrdL/ncllewH91/Lj62kwYBnfiVDXAPPuw6U5pq8 f+g3Qh/aT/HwRz4Wma7CjTDiGqY0YO0= Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-cUhYBMuiNyaExekURBh0vA-1; Thu, 28 Sep 2023 18:21:39 -0400 X-MC-Unique: cUhYBMuiNyaExekURBh0vA-1 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-7a2576bdcb7so182514739f.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=nRLk4emdibVv14kdkY4nbJYlRU6mTjtUcbhp8nIgELz/VQBScxC+qECYm6GjKvqMJj ui4TmxfEkSpVw5PCQLuG8qw/5wHeuKyWVTWwMUm/+otey+RxwKq2cGIdXaeohVN/QH+F oTPgbr94iImfXDON1g+BjC5ywLR3IXVZPCpNjJUUkGsNyge+42kLoUMT5WmsrB87oQQl H2Iun1SSYZYenLktnesAyXjM8+BFPQd0CKE3J8t01ipGgFmAsQtZeakuODvuEcoptrcE h4JsDEPr5chrjWRHUJLHzF7TzOAeDOpNm9Z2EGCHWTpTTm82PR/z2yXDTdRte6eZ6v2U skpA== X-Gm-Message-State: AOJu0Yw1dFC3kOMCLUwqZnGfKVgfvVPumksFEVQN7yVt7gdAi+TtcyXw yLSxeoceB4nGUiwf2dYKSRH9uf6XrexuN5TT/4UdWCEGn5aJIqB+ctEEcif/VivxioTNI8/HsPA /7NhAJnelmLLx0At/JE7FYL70VA== X-Received: by 2002:a05:6602:2211:b0:798:3cb5:ad30 with SMTP id n17-20020a056602221100b007983cb5ad30mr2909920ion.7.1695939698492; 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 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: x86@kernel.org, kvm@vger.kernel.org, Peter Zijlstra , Catalin Marinas , Dave Hansen , linux-kernel@vger.kernel.org, Alexander Gordeev , Claudio Imbrenda , Will Deacon , linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, Janosch Frank , Harald Freudenberger , Marc Zyngier , Huacai Chen , Halil Pasic , Andrew Thornton , Ingo Molnar , Christian Borntraeger , Jason Herne , Albert Ou , Vasily Gorbik , Venkatesh Srinivas , Heiko Carstens , Arnaldo Carvalho de Melo , Borislav Petkov , Andy Lutomirski , Paul Walmsley , kvmarm@lists.linux.dev, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Tony Krowiak , Anish Ghulati , linux-mips@vger.kernel.org, Oliver Upton , linux-perf-users@vger.kernel.org, Palmer Dabbelt , kvm-riscv@lists.infradead.org, Anup Patel , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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)) >