x86/cpu: Cleanup the untrain mess
authorPeter Zijlstra <peterz@infradead.org>
Mon, 14 Aug 2023 11:44:34 +0000 (13:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Aug 2023 11:26:59 +0000 (13:26 +0200)
commit529a9f087a7e03e87dd9c2acd687739e3e348045
tree335297700b79f3e683852ed9dc1b29930a38099d
parente6b40d2cb5aae35cc3659f9b74c999a01120ad30
x86/cpu: Cleanup the untrain mess

commit e7c25c441e9e0fa75b4c83e0b26306b702cfe90d upstream.

Since there can only be one active return_thunk, there only needs be
one (matching) untrain_ret. It fundamentally doesn't make sense to
allow multiple untrain_ret at the same time.

Fold all the 3 different untrain methods into a single (temporary)
helper stub.

Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230814121149.042774962@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/bugs.c
arch/x86/lib/retpoline.S