x86/speculation: Use generic retpoline by default on AMD
authorKim Phillips <kim.phillips@amd.com>
Mon, 28 Feb 2022 17:23:15 +0000 (11:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Mar 2022 11:11:50 +0000 (12:11 +0100)
commit2fdf67a1d215574c31b1a716f80fa0fdccd401d7
treec9d361b88d3f6ad0e0ff110f81554a740f7b6acd
parentafc2d635b5e18e2b33116d8e121ee149882e33eb
x86/speculation: Use generic retpoline by default on AMD

commit 244d00b5dd4755f8df892c86cab35fb2cfd4f14b upstream.

AMD retpoline may be susceptible to speculation. The speculation
execution window for an incorrect indirect branch prediction using
LFENCE/JMP sequence may potentially be large enough to allow
exploitation using Spectre V2.

By default, don't use retpoline,lfence on AMD.  Instead, use the
generic retpoline.

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/bugs.c