OSDN Git Service

x86/cpu: Cleanup the untrain mess
authorPeter Zijlstra <peterz@infradead.org>
Mon, 14 Aug 2023 11:44:34 +0000 (13:44 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 16 Aug 2023 19:58:59 +0000 (21:58 +0200)
commite7c25c441e9e0fa75b4c83e0b26306b702cfe90d
treed1b84a9257747a38b463571a41e63181b5252be1
parent42be649dd1f2eee6b1fb185f1a231b9494cf095f
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
arch/x86/include/asm/nospec-branch.h
arch/x86/kernel/cpu/bugs.c
arch/x86/lib/retpoline.S