X-Git-Url: https://git.proxmox.com/?p=mirror_ubuntu-artful-kernel.git;a=blobdiff_plain;f=arch%2Fx86%2Fkvm%2Fsvm.c;h=f9e7ddd56ea6e480fe41bd290884fd401c6bd93b;hp=a8c911fcd73fcb3948642e43ba044b52f736293c;hb=fe17061207ee371f0cd0f60162947deb9fd16d4a;hpb=3ef956ddb94ed8ee406947938955934da6102340 diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a8c911fcd73f..f9e7ddd56ea6 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -4901,8 +4901,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) local_irq_enable(); - if (ibrs_inuse && (svm->spec_ctrl != FEATURE_ENABLE_IBRS)) - wrmsrl(MSR_IA32_SPEC_CTRL, svm->spec_ctrl); + /* SMB: Don't care about ibrs_inuse but rely on guest value */ + x86_spec_ctrl_set_guest(svm->spec_ctrl); asm volatile ( "push %%" _ASM_BP "; \n\t" @@ -4999,11 +4999,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) /* Eliminate branch target predictions from guest mode */ vmexit_fill_RSB(); - 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); - } + x86_spec_ctrl_restore_host(svm->spec_ctrl); #ifdef CONFIG_X86_64 wrmsrl(MSR_GS_BASE, svm->host.gs_base);