Files
linux/arch/x86/include/asm
Peter Zijlstra 864bcaa38e x86/cpu/kvm: Provide UNTRAIN_RET_VM
Similar to how it doesn't make sense to have UNTRAIN_RET have two
untrain calls, it also doesn't make sense for VMEXIT to have an extra
IBPB call.

This cures VMEXIT doing potentially unret+IBPB or double IBPB.
Also, the (SEV) VMEXIT case seems to have been overlooked.

Redefine the meaning of the synthetic IBPB flags to:

 - ENTRY_IBPB     -- issue IBPB on entry  (was: entry + VMEXIT)
 - IBPB_ON_VMEXIT -- issue IBPB on VMEXIT

And have 'retbleed=ibpb' set *BOTH* feature flags to ensure it retains
the previous behaviour and issues IBPB on entry+VMEXIT.

The new 'srso=ibpb_vmexit' option only sets IBPB_ON_VMEXIT.

Create UNTRAIN_RET_VM specifically for the VMEXIT case, and have that
check IBPB_ON_VMEXIT.

All this avoids having the VMEXIT case having to check both ENTRY_IBPB
and IBPB_ON_VMEXIT and simplifies the alternatives.

Fixes: fb3bd914b3 ("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.109557833@infradead.org
2023-08-16 21:58:59 +02:00
..
2021-10-20 22:35:04 +02:00
2022-08-04 11:11:59 +02:00
2022-09-26 10:13:16 -07:00
2023-06-05 09:36:39 +02:00
2023-06-05 09:36:39 +02:00
2023-05-09 12:53:16 +02:00
2023-05-15 20:03:08 +02:00
2022-10-17 16:41:15 +02:00
2020-05-07 16:06:20 +02:00
2021-12-11 09:09:47 +01:00
2021-10-28 23:25:26 +02:00
2020-10-28 20:26:25 +01:00
2021-10-05 21:48:30 +02:00
2020-11-26 12:58:56 +01:00
2022-06-28 13:20:21 +02:00
2020-11-06 23:14:58 +01:00
2022-10-03 14:03:26 -07:00
2022-04-07 08:27:52 -07:00
2022-11-10 13:12:45 +01:00
2023-07-17 15:48:10 +02:00
2020-09-16 16:52:28 +02:00
2023-06-01 15:04:33 +02:00
2023-06-05 09:36:39 +02:00
2021-07-01 11:06:03 -07:00
2023-08-12 09:18:47 -07:00
2022-08-21 10:06:28 -07:00
2021-12-11 09:09:45 +01:00
2023-07-10 09:52:25 +02:00
2019-04-10 09:53:31 +02:00
2020-03-21 16:03:25 +01:00
2023-06-06 18:25:57 +02:00
2020-11-17 14:36:13 +01:00
2022-01-30 21:17:00 -05:00
2022-01-30 21:17:00 -05:00
2020-03-23 18:45:14 +01:00
2022-06-08 05:56:24 -04:00
2020-01-14 12:20:58 +01:00