]> git.baikalelectronics.ru Git - kernel.git/commit
x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current
authorNathan Chancellor <nathan@kernel.org>
Mon, 3 Oct 2022 13:10:36 +0000 (10:10 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Oct 2022 07:16:56 +0000 (09:16 +0200)
commit10ec9677f5c6c3784b4756c5c6593991d6019294
treee2db766563ebac1419e79d77d7d7c8196f0af9df
parentd5ed155905a81b32b994d408573ebb6560e8bf1c
x86/speculation: Use DECLARE_PER_CPU for x86_spec_ctrl_current

commit 4c9ddc6562123f64c14feb308009525356880087 upstream.

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: e1c9731dfe6b ("KVM: VMX: Prevent guest RSB poisoning attacks with eIBRS")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/nospec-branch.h