KVM: nVMX: Use correct root level for nested EPT shadow page tables
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 7 Feb 2020 17:37:41 +0000 (09:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2020 18:53:04 +0000 (19:53 +0100)
commitdb6f68908bce8eb523297e663b92a9bc913e6915
treec3d9064d25f954cc33193032189fc2d43c484e23
parentce8b9b8032bddadb1ed8fcf946ba6482f4938c51
KVM: nVMX: Use correct root level for nested EPT shadow page tables

commit 148d735eb55d32848c3379e460ce365f2c1cbe4b upstream.

Hardcode the EPT page-walk level for L2 to be 4 levels, as KVM's MMU
currently also hardcodes the page walk level for nested EPT to be 4
levels.  The L2 guest is all but guaranteed to soft hang on its first
instruction when L1 is using EPT, as KVM will construct 4-level page
tables and then tell hardware to use 5-level page tables.

Fixes: 855feb673640 ("KVM: MMU: Add 5 level EPT & Shadow page table support.")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx/vmx.c