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 86DB2C433EF for ; Wed, 13 Jul 2022 11:35:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236103AbiGMLf5 (ORCPT ); Wed, 13 Jul 2022 07:35:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiGMLf4 (ORCPT ); Wed, 13 Jul 2022 07:35:56 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1E9A83F2F; Wed, 13 Jul 2022 04:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=U1F/5wzv0m7wpoKemUgjlptyrRXhgHhVMVcmpHAB8AE=; b=ouXY6Sii0FO9X18TUWdXujmX+l nT8Tesdc6ekDaNHh/OnAGW3bI55SeuvzZZVYS9MxYlzg4sI6H1GGQFGL5lik9ww4fMhpzGjHfO4VO tXl4pgnvLC3CPa3Ld8gEkDvGyQyJVS9wD3ckp2EQfi+TeQ6yCcbyF0BtQzjvpWGT+U1RTo2Sen9XJ jG/XiI+PcUpX7nge8bsfjndRNavOnJQ1vdkd/gtNcTCq1zyBYo9zJrMIUEBBwWzAlSGcR6V97ht49 ZV4gee4B9sXAeIBajt9QNvvT3FjLL6wBQyUNvOMBDyAf/PoNa8BpLu5iaMBsLc6CKEF2HxQHUuWaa xx8Rn2gg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBaeL-003XvT-8O; Wed, 13 Jul 2022 11:35:25 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7297C300238; Wed, 13 Jul 2022 13:35:22 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 57578201ECFBD; Wed, 13 Jul 2022 13:35:22 +0200 (CEST) Date: Wed, 13 Jul 2022 13:35:22 +0200 From: Peter Zijlstra To: "Sudip Mukherjee (Codethink)" Cc: Josh Poimboeuf , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Linus Torvalds Subject: Re: mainline build failure due to fc02735b14ff ("KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS") Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2022 at 12:28:38PM +0100, Sudip Mukherjee (Codethink) wrote: > Hi All, > > The latest mainline kernel branch fails to build for x86_64 allmodconfig > with clang and the error is: > > 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; > > > git bisect pointed to fc02735b14ff ("KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS") > > I will be happy to test any patch or provide any extra log if needed. I suspect something like this will do. diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index bb05ed4f46bd..6398d39e66b0 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -280,7 +280,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);