KVM: nSVM: Set the shadow root level to the TDP level for nested NPT
authorSean Christopherson <seanjc@google.com>
Fri, 5 Mar 2021 01:10:45 +0000 (17:10 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:04 +0000 (09:50 +0200)
commit12d684302581d49ba929616dc18e7dafd546c433
treeefb5a71915abe4980bde3e36413188f3dcce84d7
parentf59c2220f6ecc5c5f8b994f679af22de75fd032d
KVM: nSVM: Set the shadow root level to the TDP level for nested NPT

commit a3322d5cd87fef5ec0037fd1b14068a533f9a60f upstream.

Override the shadow root level in the MMU context when configuring
NPT for shadowing nested NPT.  The level is always tied to the TDP level
of the host, not whatever level the guest happens to be using.

Fixes: 096586fda522 ("KVM: nSVM: Correctly set the shadow NPT root level in its MMU role")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210305011101.3597423-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/mmu/mmu.c