]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: allow KVM_REQ_GET_NESTED_STATE_PAGES outside guest mode for VMX
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 8 Jan 2021 16:43:08 +0000 (11:43 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 25 Jan 2021 23:54:09 +0000 (18:54 -0500)
commit22b6f03653eba81de87b112686f8b67523dc6265
treeeee9add1851235c455614a8dc36ea19a95de4828
parentc5ffb2f85d24afee348fd16d99de2381c61c6dcc
KVM: x86: allow KVM_REQ_GET_NESTED_STATE_PAGES outside guest mode for VMX

VMX also uses KVM_REQ_GET_NESTED_STATE_PAGES for the Hyper-V eVMCS,
which may need to be loaded outside guest mode.  Therefore we cannot
WARN in that case.

However, that part of nested_get_vmcs12_pages is _not_ needed at
vmentry time.  Split it out of KVM_REQ_GET_NESTED_STATE_PAGES handling,
so that both vmentry and migration (and in the latter case, independent
of is_guest_mode) do the parts that are needed.

Cc: <stable@vger.kernel.org> # 5.10.x: f015ce761: KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES
Cc: <stable@vger.kernel.org> # 5.10.x
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/x86.c