Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp915612imw; Wed, 13 Jul 2022 10:14:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vHi5rwdqkY+ou2Raiv4r89FvlhDjxB2IfjadvjS7kVt/yrbFbG8TGr97P73IVsTcVd5QuA X-Received: by 2002:a05:6a00:2390:b0:51c:21e1:782 with SMTP id f16-20020a056a00239000b0051c21e10782mr4077661pfc.21.1657732456241; Wed, 13 Jul 2022 10:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657732456; cv=none; d=google.com; s=arc-20160816; b=NdV8IiFWahBZBntGFgUtXe6pSU7rEhweyCxDcDBEwVRiFbxGEenxx3f969F/m5Scmx 7hSlTiC/JMkqtYsNaVNECGoWmRwkvU8oe9d9vL/N47wmq76Hfp7dLe07UiVfr+9Un5U5 WcBuvbZvQF4HwmB191Y+t+i9ixlxrMUr3bBHWL+ICPrll3KL+okE34dXl5UPI5b93LR6 CZpyE7MA0/wM+tjbSt7ALXnmqUe6HWG1SaBbHhs2K6g9VUuHbaiHr3bUoprndTjV7HXj LGYPl/JgAajTK6k9nzkMtcMiIs7yqRLUpwSzddpzPDAKbFVsoxgjeWsIvEHGjG+ds4ki Ajsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JzkEWEXD/ZVgvEv/CkKkE2P+uyhvhbEsVXT9pFIauNM=; b=dV6CJIEq7FJHkCQy+Qb1wiMxJC0uBXRYC+4SVvQn5f2m2ISltFhDoviJUAqhJt7C9b 6aHntQHehcFAlYfk246ORmoWKdDRcw+TVZnV8uodFbRn5v3h8vi6iVttY/dRCokv9YSN wdoX69A12nNCqSD8Bz+e/EP8xjC9d+93yXmWPD2y7Ij+ga66RnM2bNlFYZ1R1XWsbgyi XMjclbDR7Fv6Alj9AUR0zx4f8XFg2qoTpNul1flqp62UtkfRezkF9Y+lPZ94lVf8sdlh WFJbxmlhVeWiTlEVf8Ekmh7sikncXr8qRIv8PdS8t8xk8XFYNSq32Nqvr1PwkTuq5WW4 h88A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AZPtdVxs; 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 r14-20020a63fc4e000000b004124d98795fsi18501752pgk.322.2022.07.13.10.14.04; Wed, 13 Jul 2022 10:14:16 -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=AZPtdVxs; 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 S237179AbiGMQ1O (ORCPT + 99 others); Wed, 13 Jul 2022 12:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237165AbiGMQ1L (ORCPT ); Wed, 13 Jul 2022 12:27:11 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C4FB60FE; Wed, 13 Jul 2022 09:27:09 -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 sin.source.kernel.org (Postfix) with ESMTPS id 7DB6ECE231F; Wed, 13 Jul 2022 16:27:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BE32C34114; Wed, 13 Jul 2022 16:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657729625; bh=QsCvpn2gWQQ1jAoqmKwmo/Cv3eyEdtKIBceRVgAOtxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AZPtdVxsPialzeevmLca0Myws6u+ggFFxfdSyrByJNe/SP5gpXevDD1NpAM8cu8sC BpDecMgFuJS7TdqW7J7+2GuZoBqeA+p0aZ5rz6xC6j+TPlqCBESwHEIuU9vQVg8ikJ qzDNd3RNsCqqRR64oyz+o/dACayVru8aCSpxjbvOKKZuk0kGxSLMq2mApVn4lRTsmW 3sMjxNwZMNkmQkKWNE+YZ2b4J1yXbHzoKpGcyEcsBR0ThC4L9+JfbBl1OqpXLK4m8k AmXW35S/ShAEifVdHrvvJzQxTASyBbNiw7N0IFsBWM+B5ndKuLoqe0daeHdKZlyBqY OfEf5gs73l3GQ== Date: Wed, 13 Jul 2022 09:27:03 -0700 From: Nathan Chancellor To: Peter Zijlstra Cc: Linus Torvalds , x86@kernel.org, Nick Desaulniers , Josh Poimboeuf , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, stable@vger.kernel.org, kernel test robot Subject: Re: [PATCH v2] x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current Message-ID: References: <20220713152436.2294819-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Wed, Jul 13, 2022 at 06:22:41PM +0200, Peter Zijlstra wrote: > On Wed, Jul 13, 2022 at 08:24:37AM -0700, Nathan Chancellor wrote: > > 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 > > --- > > > > v1 -> v2: https://lore.kernel.org/20220713152222.1697913-1-nathan@kernel.org/ > > > > * Use asm/percpu.h instead of linux/percpu.h to avoid static call > > include errors. > > > > 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..10a3bfc1eb23 100644 > > --- a/arch/x86/include/asm/nospec-branch.h > > +++ b/arch/x86/include/asm/nospec-branch.h > > @@ -11,6 +11,7 @@ > > #include > > #include > > #include > > +#include > > > > #define RETPOLINE_THUNK_SIZE 32 > > > > When I tried this earlier today I ran into cyclic headers, you sure this > works? Yes, I did my regular set of x86 builds with clang and they all passed. Cheers, Nathan