SVM: nSVM: setup nested msr permission bitmap on nested state load
authorMaxim Levitsky <mlevitsk@redhat.com>
Thu, 27 Aug 2020 16:27:19 +0000 (19:27 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 12 Sep 2020 16:20:53 +0000 (12:20 -0400)
This code was missing and was forcing the L2 run with L1's msr
permission bitmap

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20200827162720.278690-3-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c

index 95fdf068fe4c1dc8f42768bea0ea6504a784043e..e90bc436f5849b3bbe4727a5cd6e59d5b687c8d1 100644 (file)
@@ -1134,6 +1134,9 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
        load_nested_vmcb_control(svm, &ctl);
        nested_prepare_vmcb_control(svm);
 
+       if (!nested_svm_vmrun_msrpm(svm))
+               return -EINVAL;
+
 out_set_gif:
        svm_set_gif(svm, !!(kvm_state->flags & KVM_STATE_NESTED_GIF_SET));
        return 0;