Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4924836rdb; Fri, 15 Sep 2023 17:33:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9VKIsFSYVRbj+Dq6GSLevl1ndx8vyeLVfE2oa/k9SVERpTgP802XCMtXzwVtzEqXBG1+D X-Received: by 2002:a05:6a00:1387:b0:68b:e29c:b69 with SMTP id t7-20020a056a00138700b0068be29c0b69mr4142151pfg.9.1694824416108; Fri, 15 Sep 2023 17:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694824416; cv=none; d=google.com; s=arc-20160816; b=g0Xydt7USFomgwS4qJHkNafCqLSZq2D3sP4S1ShjQpwk68rwgHhlEs2B3bVWRfYVmo 8fN6BiFkuojgeDMagyAsfFYomWk36BcJX9gokWJ5jVPLwS5HXGd1c6qDvJh0G5OTtWuS iIn8pEdRXuuQreQzEbUCBTnse7V0kRddV6aeaN94GkEOi2w6y0qmHd7aj0I8xl8bJUQg /fSyZ9vpH1d+aw2KcdRdmrk99g87BmiOVWm7Qfwqmxj1dU8rDvIDs7dxRZeU1bei1wZ0 B/n7giniuf2pmTYvsioq1C26PagMScEl5KgHWOfU4WIh4Wyu+qfIaa26Z4N4AgSxmhJf FFhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=CcWcgzjI/Sjr3SKdjnMS4CWAtaq/GpOs1NzqJV8HV48=; fh=kXSkXFacTVTlVHq0XnHvR0iN61knZqi7sPJIGv3JAWo=; b=zBklaa3FAerbp7NP0x/wmHa8UEjkrmcGetYNAvlVLuvRvN9kohSDOmRSSYA7eGKVW1 V9zNVULnCwel4aBYb/JGH+bVvGUvNE9SFG//V9au2cahL+9PZOEM3oFQcly+Ei+DpWXP BEsC9ix69t1yhiDOPHjo1v+MTl/jjn4933td1yPtbViORv61QF3Tx2PCea4XTYsH4T1k p8fRAw5jn65MjksRhyLp5SqL+FU7GTubfMLQ23w6xtAiTqTw3GZtA5fdFV6dQbyW7VEV v0zIyqHlJwN+ObjVR4fNxG3hZIdFtoFNY4sR66A9O8h6NMS5LzA7/eX1QU91dhDrV+EJ wk6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OuiUuscc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b25-20020a630c19000000b00564f803b104si3949267pgl.519.2023.09.15.17.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:33:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=OuiUuscc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 748D183BB584; Fri, 15 Sep 2023 17:32:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238550AbjIPAcW (ORCPT + 99 others); Fri, 15 Sep 2023 20:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238620AbjIPAcL (ORCPT ); Fri, 15 Sep 2023 20:32:11 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79C11BC1 for ; Fri, 15 Sep 2023 17:31:23 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-59b50b45481so34126557b3.1 for ; Fri, 15 Sep 2023 17:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694824283; x=1695429083; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=CcWcgzjI/Sjr3SKdjnMS4CWAtaq/GpOs1NzqJV8HV48=; b=OuiUusccrI1dBz823+RYFHRz4umrPXI3ePQ4joT6b9h1bX+K5wr0pKY7/NAepdzJ+8 N0LPT7ScUngYtOsaCgIuR7i0NDFbd/iuyX/GrqTub/2H4g8mBRJ3BiCuT/2TOAwOI+cU 31c1gRAfBEXY5+SsEVVK2ewPce5CCjAGwumjaXeiPEVU4dwXIS052fKYD6sdA5hNbwNK qbKbpVfZxrbUEcdWAfvmCIASXx1xeaTzzZDXfGsA4bSki6ozzrhs6AIP0SLDD8UbOeSl uVwl7/q4+nHxHIghDOEdOOXBUrmqaOd95gA7v28rO2+NtD7uAdx8RfT83WmbxuPgeTO9 DIuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694824283; x=1695429083; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CcWcgzjI/Sjr3SKdjnMS4CWAtaq/GpOs1NzqJV8HV48=; b=tgeWtPngB4APmlaBGLkQk+jRVqZW1oDoQA4Pf2hXtB/1l7HjEDZvfHvNG8wmzGU0Df 3ilsDNMscQSEg9CKDRsJuDWEpge5XGFqNor+2LTXBnEB8IpoKyZJOXqpLutliIptyCKS bPhnhKanNlMCF7eOmFuH8RshvqCgxvMpUbmGy8mesKi6lYJqn4nxxT31YpkbEwY7GIz4 HqsJcdqATCx+3yzk2NsaQzyW8X1B91bxMmFChIdpiBA8ADhBnfM/iwNNHP7E4dVjosNY jxG97Mj6C+lZtRvXeghI0BLFrtzqVhkx5W7kXUb8mQ5GeSm3L/+DKzMuDjqUwQN9bWzJ wfcg== X-Gm-Message-State: AOJu0YxLk9yUCr353UsOUnnSGIbnZtyDyKRagMyTZIsbCWGyFqq1trmT ko1uv0y5rh196bMqy0njatlYpnysDbE= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:b612:0:b0:565:9bee:22e0 with SMTP id u18-20020a81b612000000b005659bee22e0mr85362ywh.0.1694824282871; Fri, 15 Sep 2023 17:31:22 -0700 (PDT) Reply-To: Sean Christopherson Date: Fri, 15 Sep 2023 17:30:53 -0700 In-Reply-To: <20230916003118.2540661-1-seanjc@google.com> Mime-Version: 1.0 References: <20230916003118.2540661-1-seanjc@google.com> X-Mailer: git-send-email 2.42.0.459.ge4e396fd5e-goog Message-ID: <20230916003118.2540661-2-seanjc@google.com> Subject: [PATCH 01/26] vfio: Wrap KVM helpers with CONFIG_KVM instead of CONFIG_HAVE_KVM From: Sean Christopherson To: 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 , Sean Christopherson , Paolo Bonzini , Tony Krowiak , Halil Pasic , Jason Herne , Harald Freudenberger , Alex Williamson , Andy Lutomirski Cc: 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 15 Sep 2023 17:32:55 -0700 (PDT) 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(-) 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); -- 2.42.0.459.ge4e396fd5e-goog