From edf4b33e9f50537598637ab35598536343394947 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Thu, 11 Jan 2018 17:34:33 -0500 Subject: [PATCH] x86/spec: Always set IBRS to guest value on VMENTER and host on VMEXIT (redux) The commit bc5d49f8ee73ddf252f8a4ed106643abed3bb4d6 that was pulled was a bit stale and missing an important change. We will set the IBRS to 0 unconditionally on VMENTER. Orabug: 27378451 Reported-by: Liran Alon Reviewed-by: Liran Alon Reviewed-by: Boris Ostrovsky Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Brian Maly Signed-off-by: Kirtikar Kashyap --- arch/x86/kvm/vmx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 0ce64443f9ef..3d6da9efdda7 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -8192,8 +8192,7 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) vmx->__launched = vmx->loaded_vmcs->launched; - if (ibrs_inuse && - vmx->spec_ctrl != SPEC_CTRL_FEATURE_ENABLE_IBRS) + if (ibrs_inuse) wrmsrl(MSR_IA32_SPEC_CTRL, vmx->spec_ctrl); asm( -- 2.50.1