Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp824902imw; Wed, 13 Jul 2022 08:36:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRPxErlPfCwL4CcUykHskCeu6Z40LzWKF09fNaXn5b1kCgqzxyevtWKDMMXL+m2yXwdWA+ X-Received: by 2002:a17:906:844f:b0:72b:549e:a654 with SMTP id e15-20020a170906844f00b0072b549ea654mr3928467ejy.535.1657726590179; Wed, 13 Jul 2022 08:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657726590; cv=none; d=google.com; s=arc-20160816; b=HNKU85IvcS7yZ4M+qMY/7rtRM1jF1i1Z66UmbN1Np5f8uRiFKQNCw640iQbzAcV2fy p9oF++JGuLr66z9ZE4dNNKUU2cHgdvh3w/U0t3g8mvO0xKqLvtrVPrHfWXfI2m2MI3X2 s5KB1ltXm2gQddGWuTn1Ywf2T6t55JH0bC42SOrrt2vC7Zxhv0akjABRaOiUDA3gTsxo u+FIQhTJScA8nN90uKYqYKQDvfPHj9n0B9GGVDmrseVGMF3gv4WCju/zVZ29e8kcn465 GbE2CEipYbFSookk29xM1ONJ28KiUeb1peZ6X9kbsNAgfGEnT13uRLZU7b6XEAflyQj/ pFXw== 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=8v2hOqn3tPOSdZ+9Nkc+kvTpJP5FwgGnR+oHX0V+w1o=; b=V09hJ7ddyVY0cOPYKtNvkevQuUURtJO9lEZXlcttBdJ9rsqUvEFbXcd5jdpfhqI9zn vleEavTlSSz5CHrh0hYLFpJQ5XRKRDOvylSePjgbGTHQyXgzpQ462+A7CMqQ9a+uGn53 dW6FZIj3tATopDgUj/BNMUkpEQMgYINg5y3KddOw0ec4PUq1x61ltCNuNu46hhtkqyGj dn0/U3eC9vSmp7HPJqje+n+sNemwp8qW6H6SiF14BFxe9E6+ex4ZeN/bMfJD99Xs8juI t7s44QbLUw2nugh0fobqrRe85Xq84J+bvSNwzo/BT5Jy14DDu6U1Vo4/CogVF/NAH6Yw dk4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oJNOIyWh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc12-20020a170906dfec00b0070870e20c98si16949101ejc.123.2022.07.13.08.36.03; Wed, 13 Jul 2022 08:36:30 -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=@kernel.org header.s=k20201202 header.b=oJNOIyWh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236647AbiGMPWq (ORCPT + 99 others); Wed, 13 Jul 2022 11:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236484AbiGMPWn (ORCPT ); Wed, 13 Jul 2022 11:22:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1B1D46DB2; Wed, 13 Jul 2022 08:22:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6079A614AD; Wed, 13 Jul 2022 15:22:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33289C34114; Wed, 13 Jul 2022 15:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657725761; bh=M3s3z9XPrbSeW+ifjj4FlEwxjuV9nAI5u3w331qUeyQ=; h=From:To:Cc:Subject:Date:From; b=oJNOIyWhDB/OL2qVkQeFvanYA9xYBoaLVB7SSptFZZGaax6vHQOYNKi04FQjuVjBP RQT3STyQhVJCuh69pd7dgNk+6GHzytZKFoX4B5mzy3H34qa2NTuzTQmTw2w+KHyHrt JuRM9czFqm/akALRtKKfZU/g9zf2O9OUYwSbDzu9nvQomSSlhglqH94HDk0oYoGKH2 SyQVkxrQQ03sYnlJmXt+JXyJs7qycJwSZr8ISuJS9mxBSn/xaGlvs5CYcCmqhq+pfE LqrP/OQw4a7tiUD+sjYiZFmJO7wSxP0Q0FoGaXu8/Rse+dBkMKPxWbhySSP9xNaNPM 4KR/HaDclrQ9w== From: Nathan Chancellor To: Linus Torvalds , x86@kernel.org Cc: Nick Desaulniers , Peter Zijlstra , Josh Poimboeuf , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , stable@vger.kernel.org, kernel test robot Subject: [PATCH] x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current Date: Wed, 13 Jul 2022 08:22:22 -0700 Message-Id: <20220713152222.1697913-1-nathan@kernel.org> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Clang warns: arch/x86/kernel/cpu/bugs.c:58:21: error: section attribute is specified on redeclared variable [-Werror,-Wsection] DEFINE_PER_CPU(u64, x86_spec_ctrl_current); ^ arch/x86/include/asm/nospec-branch.h:283:12: note: previous declaration is here extern u64 x86_spec_ctrl_current; ^ 1 error generated. The declaration should be using DECLARE_PER_CPU instead so all attributes stay in sync. Cc: stable@vger.kernel.org Fixes: fc02735b14ff ("KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS") Reported-by: kernel test robot Signed-off-by: Nathan Chancellor --- arch/x86/include/asm/nospec-branch.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index bb05ed4f46bd..99a29c83adf8 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -280,7 +281,7 @@ static inline void indirect_branch_prediction_barrier(void) /* The Intel SPEC CTRL MSR base value cache */ extern u64 x86_spec_ctrl_base; -extern u64 x86_spec_ctrl_current; +DECLARE_PER_CPU(u64, x86_spec_ctrl_current); extern void write_spec_ctrl_current(u64 val, bool force); extern u64 spec_ctrl_current(void); base-commit: 72a8e05d4f66b5af7854df4490e3135168694b6b -- 2.37.1