OSDN Git Service

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>
Mon, 24 Feb 2020 07:34:35 +0000 (08:34 +0100)
commit2130de7d5e1ab1d5725b2e2c923fb6238a471131
tree78ef458a3a2c067944f8023859b55dc57b9a6a57
parent9c270ce33da574a3738cc19376e7e5fdb223d7df
KVM: nVMX: Use correct root level for nested EPT shadow page tables

[ Upstream commit 148d735eb55d32848c3379e460ce365f2c1cbe4b ]

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: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/vmx.c