Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp118366imn; Wed, 27 Jul 2022 17:13:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vxALV8ofdA8u0jwcq/bj67ENjfNuAnefzBNsPsm3LzAAEe8UHzjEuIc+gUcltbGp4yDXUJ X-Received: by 2002:a17:907:6da9:b0:72b:58ca:e3a8 with SMTP id sb41-20020a1709076da900b0072b58cae3a8mr19897057ejc.342.1658967180961; Wed, 27 Jul 2022 17:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658967180; cv=none; d=google.com; s=arc-20160816; b=kOU8R7aDfQytTUnDDJvWyq2IjylTMbbg7j66ohIhZD+F6CdnPq/sH8hna2fmHz/bOv sA+ofcj498Rif/r0QEOJJeXcYBe3jaBbGC4Dm2v5wbrnCRWgJylVWsI8XfUMoLTk3t/2 P7GBJSQYHB4Uy/m4dVmLmpAMHArn3wcGN9+uGV4KT8GvnFC34YhHGv7PZvG3v6sWefV2 +uMmN4hdhNpzXnL1gZSbv4wWBcPLMvL+W0+Wztflzfmk9B+I58ighMDYzf+aTYyCdu6+ YuXxTPMALD2z/y4TRSkjTFnSnzSjJLBXVAbVckaoFcif5Y7oehLZhEUkxRYulCylM5S3 GSZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mBsuLV2Kcuz0I195V1tt9wJXgZd8wQhbwFhjdKnnIJE=; b=cocmPBu4t6xIBaRSiOaJnTP++jImsR3iMFQsuv5U/UICzvUUneFVgsvBCzimS+WuEX P2+GTKOkP9LjJ/JS9cVNeMiVHVlnjflGyowvKK+VoLt6CZivhkGBC/EkGoholGnLy6ax m5t8WEDAOFNlKplsAzDYXc5bKrK+JQESynb3Gc9VXmilgyL+nzfEoXCpOQxCIOnQqJYk nuze0ERGvlSQtXssOEho70gkJHjsIUQQ1eJ81ZKhkWrexJ9rOWGnHce5FpSDy0o3QKM+ Pen04b8lC1G/kOE7V6KXjoMkuOMwQXAENzbC0Fm5gmDAkWo4Zb9vCj4iVCEvzhlqdXhT 2rpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@profian-com.20210112.gappssmtp.com header.s=20210112 header.b=l3MGDDEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js7-20020a17090797c700b0072b0f6f1456si6476288ejc.612.2022.07.27.17.12.34; Wed, 27 Jul 2022 17:13:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@profian-com.20210112.gappssmtp.com header.s=20210112 header.b=l3MGDDEd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234471AbiG1ACe (ORCPT + 99 others); Wed, 27 Jul 2022 20:02:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234327AbiG1ACd (ORCPT ); Wed, 27 Jul 2022 20:02:33 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 922EC491F1 for ; Wed, 27 Jul 2022 17:02:31 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id m12so575225lfj.4 for ; Wed, 27 Jul 2022 17:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profian-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mBsuLV2Kcuz0I195V1tt9wJXgZd8wQhbwFhjdKnnIJE=; b=l3MGDDEdS9t9yQxk624TuJG1yi8Q65z7u1Kbu1NGAGE5iTZqEyvSpMIssIgZqFbcog tgnqIdBLB5ZyY01UAVkhNmm08bUwvtYktXorCFReTU6g1W3UEQ71DFIvS1QxHdwBYaBe l1dkPVjdWppEix7iwqiFhqXCBId631FcZLwaU+RdLbVqguhF2XtJkWgCGKKKWQ7+EOi3 YVyXFf9I+QMPBz/N/FzKGSfpAidyW1O2O2Q9dqX9sywEb0g7SbOSdNzAhzbhRSLirQ9R f06nl3wGAqpcepN/PuNK/WvfOceNFDYHD+Bzpj+S7lEbu5x1YuTZzkIvVBFEO41MccVj J/Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mBsuLV2Kcuz0I195V1tt9wJXgZd8wQhbwFhjdKnnIJE=; b=YfS8xulMTPwmrF7AMQ/odiIkSJKsW4OHCAlD0jYeznB4CXZUMlm8ZGyHUzYkTPfcn+ F/6k10L3rseS8jnH55gmbvX4DOrpGUgQar+4NOd+PvoPkkMgD6gY7t5aAC/t80jMAkkP dNInA/dWPRyLx3dmDmYykv0SOclLoCGDQfZVHCS6GJUPVi3g3xMZEbOapGJrlpByy+U/ X2Y1LR6mD8lIWr3Pxsy8/mkN4nRYbP4pczLzFW12wa4+H1Ghh4l6Qolxmkny5mkfKyLn q4WoR10kxVY0NoICD1zLcgpBtl/pivWj4zoitMVvWC9vo8ID2F4l4u8VTI3uP/VDdJR1 44Vw== X-Gm-Message-State: AJIora/ydXNObzmZHJh3FYUalpURKt6nJHsoCjqQdvUwviHLycUDlBtP h9uw3G/vh3YNg0E12xjdYKUvFA== X-Received: by 2002:a05:6512:1694:b0:48a:9d45:763f with SMTP id bu20-20020a056512169400b0048a9d45763fmr4368355lfb.662.1658966549714; Wed, 27 Jul 2022 17:02:29 -0700 (PDT) Received: from localhost (91-154-92-55.elisa-laajakaista.fi. [91.154.92.55]) by smtp.gmail.com with ESMTPSA id q27-20020ac2515b000000b0048a897adbc9sm2096529lfd.211.2022.07.27.17.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 17:02:29 -0700 (PDT) From: Jarkko Sakkinen To: Paolo Bonzini Cc: Jarkko Sakkinen , stable@vger.kernel.org, Jarkko Sakkinen , Sean Christopherson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , Brijesh Singh , Isaku Yamahata , kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)), linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH] KVM: x86/mmu: Fix incorrect use of CONFIG_RETPOLINE Date: Thu, 28 Jul 2022 03:02:21 +0300 Message-Id: <20220728000221.19088-1-jarkko@profian.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use "#ifdef" instead of "#if", as it is possible to select KVM without enabling RETPOLINE. Adding the following list of flags on top of tinyconfig is an example of a failing config file: CONFIG_64BIT=y CONFIG_PCI=y CONFIG_ACPI=y CONFIG_VIRTUALIZATION=y CONFIG_HIGH_RES_TIMERS=y CONFIG_CRYPTO=y CONFIG_DMADEVICES=y CONFIG_X86_MCE=y CONFIG_RETPOLINE=y CONFIG_MEMORY_FAILURE=y CONFIG_KVM=y CONFIG_KVM_AMD=y CONFIG_CRYPTO_DEV_CCP=y CONFIG_CRYPTO_DEV_CCP_DD=y CONFIG_CRYPTO_DEV_SP_CCP=y CONFIG_CRYPTO_DEV_SP_PSP=y CONFIG_KVM_AMD_SEV=y CONFIG_AMD_MEM_ENCRYPT=y CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=n Cc: stable@vger.kernel.org # 5.19 Cc: Jarkko Sakkinen Fixes: d1f5c8366288 ("KVM: x86/mmu: Introduce kvm_mmu_map_tdp_page() for use by TDX and SNP") Signed-off-by: Jarkko Sakkinen --- arch/x86/kvm/mmu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 0b99ee4ea184..e08c7e85bbb9 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4213,7 +4213,7 @@ kvm_pfn_t kvm_mmu_map_tdp_page(struct kvm_vcpu *vcpu, gpa_t gpa, * direct_page_fault() when appropriate. */ //r = direct_page_fault(vcpu, &fault); -#if CONFIG_RETPOLINE +#ifdef CONFIG_RETPOLINE if (fault.is_tdp) r = kvm_tdp_page_fault(vcpu, &fault); #else -- 2.36.1