@@ -1171,6 +1171,21 @@ static enum retbleed_mitigation retbleed_mitigation __ro_after_init =
1171
1171
1172
1172
static int __ro_after_init retbleed_nosmt = false;
1173
1173
1174
+ enum srso_mitigation {
1175
+ SRSO_MITIGATION_NONE ,
1176
+ SRSO_MITIGATION_AUTO ,
1177
+ SRSO_MITIGATION_UCODE_NEEDED ,
1178
+ SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED ,
1179
+ SRSO_MITIGATION_MICROCODE ,
1180
+ SRSO_MITIGATION_NOSMT ,
1181
+ SRSO_MITIGATION_SAFE_RET ,
1182
+ SRSO_MITIGATION_IBPB ,
1183
+ SRSO_MITIGATION_IBPB_ON_VMEXIT ,
1184
+ SRSO_MITIGATION_BP_SPEC_REDUCE ,
1185
+ };
1186
+
1187
+ static enum srso_mitigation srso_mitigation __ro_after_init = SRSO_MITIGATION_AUTO ;
1188
+
1174
1189
static int __init retbleed_parse_cmdline (char * str )
1175
1190
{
1176
1191
if (!str )
@@ -1280,6 +1295,10 @@ static void __init retbleed_update_mitigation(void)
1280
1295
if (its_mitigation == ITS_MITIGATION_RETPOLINE_STUFF )
1281
1296
retbleed_mitigation = RETBLEED_MITIGATION_STUFF ;
1282
1297
1298
+ /* If SRSO is using IBPB, that works for retbleed too */
1299
+ if (srso_mitigation == SRSO_MITIGATION_IBPB )
1300
+ retbleed_mitigation = RETBLEED_MITIGATION_IBPB ;
1301
+
1283
1302
if (retbleed_mitigation == RETBLEED_MITIGATION_STUFF &&
1284
1303
!cdt_possible (spectre_v2_enabled )) {
1285
1304
pr_err ("WARNING: retbleed=stuff depends on retpoline\n" );
@@ -2845,19 +2864,6 @@ early_param("l1tf", l1tf_cmdline);
2845
2864
#undef pr_fmt
2846
2865
#define pr_fmt (fmt ) "Speculative Return Stack Overflow: " fmt
2847
2866
2848
- enum srso_mitigation {
2849
- SRSO_MITIGATION_NONE ,
2850
- SRSO_MITIGATION_AUTO ,
2851
- SRSO_MITIGATION_UCODE_NEEDED ,
2852
- SRSO_MITIGATION_SAFE_RET_UCODE_NEEDED ,
2853
- SRSO_MITIGATION_MICROCODE ,
2854
- SRSO_MITIGATION_NOSMT ,
2855
- SRSO_MITIGATION_SAFE_RET ,
2856
- SRSO_MITIGATION_IBPB ,
2857
- SRSO_MITIGATION_IBPB_ON_VMEXIT ,
2858
- SRSO_MITIGATION_BP_SPEC_REDUCE ,
2859
- };
2860
-
2861
2867
static const char * const srso_strings [] = {
2862
2868
[SRSO_MITIGATION_NONE ] = "Vulnerable" ,
2863
2869
[SRSO_MITIGATION_UCODE_NEEDED ] = "Vulnerable: No microcode" ,
@@ -2870,8 +2876,6 @@ static const char * const srso_strings[] = {
2870
2876
[SRSO_MITIGATION_BP_SPEC_REDUCE ] = "Mitigation: Reduced Speculation"
2871
2877
};
2872
2878
2873
- static enum srso_mitigation srso_mitigation __ro_after_init = SRSO_MITIGATION_AUTO ;
2874
-
2875
2879
static int __init srso_parse_cmdline (char * str )
2876
2880
{
2877
2881
if (!str )
0 commit comments