]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: move check_vmentry_postreqs() call to nested_vmx_enter_non_root_mode()
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 26 Sep 2018 16:23:46 +0000 (09:23 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Oct 2018 22:29:53 +0000 (00:29 +0200)
commit6ee984fbac8806c126ebe0d11633cae5ffe9149b
treed6e75dd18e51ff0d5b1511c672a3d80aad59a048
parentabef313ce04d3652dba17a7dad5cccd4f1b94f40
KVM: nVMX: move check_vmentry_postreqs() call to nested_vmx_enter_non_root_mode()

In preparation of supporting checkpoint/restore for nested state,
commit 47e220b3e2ca ("kvm: nVMX: Split VMCS checks from nested_vmx_run()")
modified check_vmentry_postreqs() to only perform the guest EFER
consistency checks when nested_run_pending is true.  But, in the
normal nested VMEntry flow, nested_run_pending is only set after
check_vmentry_postreqs(), i.e. the consistency check is being skipped.

Alternatively, nested_run_pending could be set prior to calling
check_vmentry_postreqs() in nested_vmx_run(), but placing the
consistency checks in nested_vmx_enter_non_root_mode() allows us
to split prepare_vmcs02() and interleave the preparation with
the consistency checks without having to change the call sites
of nested_vmx_enter_non_root_mode().  In other words, the rest
of the consistency check code in nested_vmx_run() will be joining
the postreqs checks in future patches.

Fixes: 47e220b3e2ca ("kvm: nVMX: Split VMCS checks from nested_vmx_run()")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Jim Mattson <jmattson@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c