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:22:32 +0000 (12:22 +0100)
commita56566d7a957c34811384d6300a53a97be94cd20
treef8892c48d1dc2cc08d78fb44862cc85d04a4054a
parent316e4a16524a2d2ce321f57c1abe4df9ef90f950
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