From: Jun Nakajima Date: Wed, 20 Dec 2017 16:04:49 +0000 (-0800) Subject: Use the "ibrs_inuse" variable. X-Git-Tag: v4.1.12-124.31.3~1395 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1e9b15f8f6a1c6e0876b0121d204987df6e4c487;p=users%2Fjedix%2Flinux-maple.git Use the "ibrs_inuse" variable. Orabug: 27344012 CVE: CVE-2017-5715 Signed-off-by: Jun Nakajima Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: John Haxby Signed-off-by: Kirtikar Kashyap --- diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index f76181493fd4..a9b04baf01b3 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -3930,7 +3930,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) local_irq_enable(); - if (static_cpu_has(X86_FEATURE_SPEC_CTRL) && + if (ibrs_inuse && svm->spec_ctrl != FEATURE_ENABLE_IBRS) wrmsrl(MSR_IA32_SPEC_CTRL, svm->spec_ctrl); @@ -4026,7 +4026,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) #endif ); - if (static_cpu_has(X86_FEATURE_SPEC_CTRL)) { + if (ibrs_inuse) { rdmsrl(MSR_IA32_SPEC_CTRL, svm->spec_ctrl); if (svm->spec_ctrl != FEATURE_ENABLE_IBRS) wrmsrl(MSR_IA32_SPEC_CTRL, FEATURE_ENABLE_IBRS);