diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-08-14 13:44:34 +0200 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2023-08-16 21:58:59 +0200 |
commit | e7c25c441e9e0fa75b4c83e0b26306b702cfe90d (patch) | |
tree | d1b84a9257747a38b463571a41e63181b5252be1 /arch/x86/lib | |
parent | x86/cpu: Rename srso_(.*)_alias to srso_alias_\1 (diff) | |
download | linux-e7c25c441e9e0fa75b4c83e0b26306b702cfe90d.tar.xz linux-e7c25c441e9e0fa75b4c83e0b26306b702cfe90d.zip |
x86/cpu: Cleanup the untrain mess
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
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/retpoline.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index d37e5ab0d5ee..5e85da150e96 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -289,6 +289,13 @@ SYM_CODE_START(srso_return_thunk) ud2 SYM_CODE_END(srso_return_thunk) +SYM_FUNC_START(entry_untrain_ret) + ALTERNATIVE_2 "jmp retbleed_untrain_ret", \ + "jmp srso_untrain_ret", X86_FEATURE_SRSO, \ + "jmp srso_alias_untrain_ret", X86_FEATURE_SRSO_ALIAS +SYM_FUNC_END(entry_untrain_ret) +__EXPORT_THUNK(entry_untrain_ret) + SYM_CODE_START(__x86_return_thunk) UNWIND_HINT_FUNC ANNOTATE_NOENDBR |