Skip to content

Commit 881ccfc

Browse files
achartrevijay-suman
authored andcommitted
x86/bhi: Do not enable unnecessary BHI mitigation in OCI and Exadata VMs
The BHI mitigation logic can enable unnecessary extra BHI mitigation in virtual machines when the host server is using an Intel CPU without eIBRS. Enabling this extra mitigation has a performance impact on every syscall and impact VMs running on OCI and Exadata servers based on Intel Haswell, Broadwell and Skylake CPUs. To avoid the impact on OCI and Exadata servers, make sure no extra BHI mitigation is enabled on Haswell, Broadwell and Skylake servers. Note that this change is not present in upstream kernel as no consensus has been reached on how to handle this issue. It should eventually be replaced by the upstream fix if one is ever integrated. In the meantime, this fix is used to provide a quick and simple relief for OCI and Exadata VMs. Orabug: 36672493 Signed-off-by: Alexandre Chartre <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]>
1 parent 0280376 commit 881ccfc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

arch/x86/kernel/cpu/common.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,28 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
11851185
VULNWL_INTEL(INTEL_ATOM_TREMONT_L, NO_EIBRS_PBRSB),
11861186
VULNWL_INTEL(INTEL_ATOM_TREMONT_D, NO_ITLB_MULTIHIT | NO_EIBRS_PBRSB),
11871187

1188+
/*
1189+
* CPUs without eIBRS can be impacted by BHI. However, the default
1190+
* Spectre v2 mitigations will also mitigate BHI. So X86_BUG_BHI is
1191+
* not set on these CPUs and no extra BHI mitigation is applied.
1192+
*
1193+
* However, this logic is not applied in a vitual machine because the
1194+
* VM can't know if the CPU doesn't effectively have eIBRS, or if eIBRS
1195+
* was hidden by the hypervisor. So the VM might apply extra BHI
1196+
* mitigation while this is not needed.
1197+
*
1198+
* To avoid OCI and Exadata VMs from using unnecessary BHI mitigation
1199+
* (and avoid the associated performance impact), we explicitly mark the
1200+
* Intel CPUs used by OCI and Exadata which do not have eIBRS with NO_BHI
1201+
* so that no extra BHI mitigation is used even in VMs.
1202+
*
1203+
* Intel CPUs without eIBRS used by OCI and Exadata are Haswell Server,
1204+
* Broadwell Server and Skylake Server.
1205+
*/
1206+
VULNWL_INTEL(INTEL_HASWELL_X, NO_BHI),
1207+
VULNWL_INTEL(INTEL_BROADWELL_X, NO_BHI),
1208+
VULNWL_INTEL(INTEL_SKYLAKE_X, NO_BHI),
1209+
11881210
/* AMD Family 0xf - 0x12 */
11891211
VULNWL_AMD(0x0f, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT | NO_MMIO | NO_BHI),
11901212
VULNWL_AMD(0x10, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT | NO_MMIO | NO_BHI),

0 commit comments

Comments
 (0)