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 09:03:31 +0000 (10:03 +0100)
commitb6a1aec08a84ccb331ce526c051df074150cf3c5
treeea1888bbcde53359be82188439aef72ee9a8026e
parent6481835a9a5b74e349e5c20ae8a9cb10a2e907fa
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: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/bugs.c