Re: [PATCH] x86/speculation: Add BHI_DIS support

From: Boris Petkov
Date: Thu Jul 14 2022 - 15:58:22 EST


On July 14, 2022 7:52:35 PM UTC, Daniel Sneddon <daniel.sneddon@xxxxxxxxxxxxxxx> wrote:
>Branch History Injection (BHI) attacks can be mitigated using the
>BHI_DIS_S indirect predictor control bit located in MSR_IA32_SPEC_CTRL
>register. Set BHI_DIS in MSR_IA32_SPC_CTRL to prevent predicted
>targets of indirect branches executed in CPL0, CPL1, or CPL2 from
>being selected based on branch history from branches executed in CPL3.
>Support for this feature is enumerated by CPUID.7.2.EDX[BHI_CTRL] (bit 4).
>
>Users wanting BHI protection can specify spectre_v2=eibrs,bhi_dis to
>enable hardware BHI protections. On platforms where BHI protections
>are not available in the hardware revert to eibrs,retpoline
>mitigations.

Why is this a separately selectable option and not automatically enabled?

--
Sent from a small device: formatting sux and brevity is inevitable.