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 6DA0EE743C8 for ; Thu, 28 Sep 2023 22:23:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232586AbjI1WXC (ORCPT ); Thu, 28 Sep 2023 18:23:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231864AbjI1WXB (ORCPT ); Thu, 28 Sep 2023 18:23:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F55C1A2 for ; Thu, 28 Sep 2023 15:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695939698; 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=rT9am+jLmHorOzbZRxZ3QKMwJmosafd47BiiQuOc1Lw=; b=hgUc8sqzTnH/mSPVzvy2P9DhDFskybZw1lsg/2CppeFl09UTTaihCUCRxhbXbblrHvT39s TQhsGaKcBU8HIMWzo62Pl/jeDqE2z7BVP2UU20AdFmc/C+aPuDJ49OhQ1W4/JY3ArTAWd3 dhXsKeZ61tTjhbZ/DUQX0TWmwY3U4QI= 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-299-uANZap9fO_iDbte3WH8HcQ-1; Thu, 28 Sep 2023 18:21:37 -0400 X-MC-Unique: uANZap9fO_iDbte3WH8HcQ-1 Received: by mail-io1-f69.google.com with SMTP id ca18e2360f4ac-786a6443490so1640130639f.0 for ; Thu, 28 Sep 2023 15:21:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695939696; x=1696544496; 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=rT9am+jLmHorOzbZRxZ3QKMwJmosafd47BiiQuOc1Lw=; b=tYZajV7SHPThgjgdQJ1fhdS7MWS86EbSUitgCeB/w1YYy64YDteoVAWyTHSWwd8tLM bcSx9IrpklRHT06jTsrtggR2+AgppORh4rmdUsfXmU8Q0ntV3DN2xevi6bOs22ipsvOo KSXcpo+aBVcKZKV0fySiLHSMz6HMWTOuDfRMg8td+ilVv/2Mbj7yIIZ/wRTIxYaDHXT4 vY0reprWxeNBXXp3ZX4y4IIGqWFD9r+YUrehf6ylnqkIKesSY078sEX0qqStagWQwNjT eLseUjsjcyesOqVAM4O+ZdPBIOvxJmTZLbvJ6OAFBcIPkhiFerofNKpbgVy9f9NLezmL Qi2Q== X-Gm-Message-State: AOJu0YyCuR/SHG4MsTZKVjZO/kBy1aGd9w/Gf8z+XNTZ68JELJOOEde1 DbOlkmai+V04fa11XIjXUvH9gvY9qr47dBlsvYb/lkN7tI7AMx6+ST9fHHXjOXvkSds1IAF+Yxt vqgJCe4oifYGsCwnTrbG6+g== X-Received: by 2002:a6b:a12:0:b0:792:792e:6619 with SMTP id z18-20020a6b0a12000000b00792792e6619mr2822980ioi.2.1695939696193; Thu, 28 Sep 2023 15:21:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvHyy/Hemz69W4ceT0BNd5Cdmv5i7C45WBCarFFElXolFsYoe8vV4yGo1CGx8WsH3XpWDdNw== X-Received: by 2002:a6b:a12:0:b0:792:792e:6619 with SMTP id z18-20020a6b0a12000000b00792792e6619mr2822961ioi.2.1695939695939; Thu, 28 Sep 2023 15:21:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 15:21:34 -0700 (PDT) Date: Thu, 28 Sep 2023 16:21:03 -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 01/26] vfio: Wrap KVM helpers with CONFIG_KVM instead of CONFIG_HAVE_KVM Message-ID: <20230928162103.433f03db.alex.williamson@redhat.com> In-Reply-To: <20230916003118.2540661-2-seanjc@google.com> References: <20230916003118.2540661-1-seanjc@google.com> <20230916003118.2540661-2-seanjc@google.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Fri, 15 Sep 2023 17:30:53 -0700 Sean Christopherson wrote: > Wrap the helpers for getting references to KVM instances with a check on > CONFIG_KVM being enabled, not on CONFIG_HAVE_KVM being defined. PPC does > NOT select HAVE_KVM, despite obviously supporting KVM, and guarding code > to get references to KVM based on whether or not the architecture supports > KVM is nonsensical. > > Drop the guard around linux/kvm_host.h entirely, conditionally including a > generic headers is completely unnecessary. > > Signed-off-by: Sean Christopherson > --- > drivers/vfio/vfio.h | 2 +- > drivers/vfio/vfio_main.c | 4 +--- > 2 files changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Alex Williamson > diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h > index 307e3f29b527..c26d1ad68105 100644 > --- a/drivers/vfio/vfio.h > +++ b/drivers/vfio/vfio.h > @@ -434,7 +434,7 @@ static inline void vfio_virqfd_exit(void) > } > #endif > > -#ifdef CONFIG_HAVE_KVM > +#if IS_ENABLED(CONFIG_KVM) > void vfio_device_get_kvm_safe(struct vfio_device *device, struct kvm *kvm); > void vfio_device_put_kvm(struct vfio_device *device); > #else > diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c > index 40732e8ed4c6..80e39f7a6d8f 100644 > --- a/drivers/vfio/vfio_main.c > +++ b/drivers/vfio/vfio_main.c > @@ -16,9 +16,7 @@ > #include > #include > #include > -#ifdef CONFIG_HAVE_KVM > #include > -#endif > #include > #include > #include > @@ -383,7 +381,7 @@ void vfio_unregister_group_dev(struct vfio_device *device) > } > EXPORT_SYMBOL_GPL(vfio_unregister_group_dev); > > -#ifdef CONFIG_HAVE_KVM > +#if IS_ENABLED(CONFIG_KVM) > void vfio_device_get_kvm_safe(struct vfio_device *device, struct kvm *kvm) > { > void (*pfn)(struct kvm *kvm);