]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: WARN on any attempt to allocate shadow VMCS for vmcs02
authorSean Christopherson <seanjc@google.com>
Tue, 25 Jan 2022 22:05:27 +0000 (22:05 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Jan 2022 17:15:04 +0000 (12:15 -0500)
commitc5dcccdf95ce6ff1544c560e8498fb3d932edd48
treebaa1358ffb64afbc2e1904f3e96886b861041166
parenta80aecde2f9af94dc77bafbd5561eb64b7e6026a
KVM: nVMX: WARN on any attempt to allocate shadow VMCS for vmcs02

WARN if KVM attempts to allocate a shadow VMCS for vmcs02.  KVM emulates
VMCS shadowing but doesn't virtualize it, i.e. KVM should never allocate
a "real" shadow VMCS for L2.

The previous code WARNed but continued anyway with the allocation,
presumably in an attempt to avoid NULL pointer dereference.
However, alloc_vmcs (and hence alloc_shadow_vmcs) can fail, and
indeed the sole caller does:

if (enable_shadow_vmcs && !alloc_shadow_vmcs(vcpu))
goto out_shadow_vmcs;

which makes it not a useful attempt.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220125220527.2093146-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c