x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 27 Oct 2022 20:55:12 +0000 (13:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Nov 2022 18:14:45 +0000 (19:14 +0100)
commitc34ffb2a83b9bf4724515a944583f931973a80f6
treea44fd08ee0dd7c821776d1b4cc7207b1656c2b29
parent48bfe6ca381525bd3b7e4d360a4695792ace4c55
x86/speculation: Fix RSB filling with CONFIG_RETPOLINE=n

commit b2620facef4889fefcbf2e87284f34dcd4189bce upstream.

If a kernel is built with CONFIG_RETPOLINE=n, but the user still wants
to mitigate Spectre v2 using IBRS or eIBRS, the RSB filling will be
silently disabled.

There's nothing retpoline-specific about RSB buffer filling.  Remove the
CONFIG_RETPOLINE guards around it.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/entry/entry_32.S
arch/x86/entry/entry_64.S
arch/x86/include/asm/nospec-branch.h