* The VMCB could be recycled, causing a false negative in svm_vcpu_load;
* block speculative execution.
*/
- if (static_cpu_has(X86_FEATURE_IBPB_SUPPORT))
+ if (ibpb_inuse)
wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);
}
}
if (sd->current_vmcb != svm->vmcb) {
sd->current_vmcb = svm->vmcb;
- if (static_cpu_has(X86_FEATURE_IBPB_SUPPORT))
+ if (ibpb_inuse)
wrmsrl(MSR_IA32_PRED_CMD, FEATURE_SET_IBPB);
}
if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
vmx_set_interrupt_shadow(vcpu, 0);
- if (static_cpu_has(X86_FEATURE_SPEC_CTRL) &&
+ if (ibpb_inuse &&
vmx->spec_ctrl != FEATURE_ENABLE_IBRS)
wrmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl);
#endif
);
- if (static_cpu_has(X86_FEATURE_SPEC_CTRL)) {
+ if (ibpb_inuse) {
rdmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl);
if (vmx->spec_ctrl)
wrmsrl(MSR_IA32_SPEC_CTRL, FEATURE_ENABLE_IBRS);