Skip to content

Commit 18bae0d

Browse files
jpoimboeIngo Molnar
authored andcommitted
x86/bugs: Don't fill RSB on VMEXIT with eIBRS+retpoline
eIBRS protects against guest->host RSB underflow/poisoning attacks. Adding retpoline to the mix doesn't change that. Retpoline has a balanced CALL/RET anyway. So the current full RSB filling on VMEXIT with eIBRS+retpoline is overkill. Disable it or do the VMEXIT_LITE mitigation if needed. Suggested-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com> Reviewed-by: Amit Shah <amit.shah@amd.com> Reviewed-by: Nikolay Borisov <nik.borisov@suse.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Cc: Sean Christopherson <seanjc@google.com> Cc: David Woodhouse <dwmw2@infradead.org> Link: https://lore.kernel.org/r/84a1226e5c9e2698eae1b5ade861f1b8bf3677dc.1744148254.git.jpoimboe@kernel.org
1 parent b1b19cf commit 18bae0d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,20 +1617,20 @@ static void __init spectre_v2_determine_rsb_fill_type_at_vmexit(enum spectre_v2_
16171617
case SPECTRE_V2_NONE:
16181618
return;
16191619

1620-
case SPECTRE_V2_EIBRS_LFENCE:
16211620
case SPECTRE_V2_EIBRS:
1621+
case SPECTRE_V2_EIBRS_LFENCE:
1622+
case SPECTRE_V2_EIBRS_RETPOLINE:
16221623
if (boot_cpu_has_bug(X86_BUG_EIBRS_PBRSB)) {
1623-
setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT_LITE);
16241624
pr_info("Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT\n");
1625+
setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT_LITE);
16251626
}
16261627
return;
16271628

1628-
case SPECTRE_V2_EIBRS_RETPOLINE:
16291629
case SPECTRE_V2_RETPOLINE:
16301630
case SPECTRE_V2_LFENCE:
16311631
case SPECTRE_V2_IBRS:
1632-
setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT);
16331632
pr_info("Spectre v2 / SpectreRSB : Filling RSB on VMEXIT\n");
1633+
setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT);
16341634
return;
16351635
}
16361636

0 commit comments

Comments
 (0)