]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Grab shadow root level from mmu_role for shadow MMUs
authorSean Christopherson <seanjc@google.com>
Tue, 22 Jun 2021 17:57:04 +0000 (10:57 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 24 Jun 2021 22:00:39 +0000 (18:00 -0400)
commit4f098a6e3590e7c275fe7dacba79aaee2c3a19c0
tree31a2f4c1700d1a9c15c7bcddd7988bdc281b332a
parente437d831c87d0f22a2163ceb8eaf9f74826ea309
KVM: x86/mmu: Grab shadow root level from mmu_role for shadow MMUs

Use the mmu_role to initialize shadow root level instead of assuming the
level of KVM's shadow root (host) is the same as that of the guest root,
or in the case of 32-bit non-PAE paging where KVM forces PAE paging.
For nested NPT, the shadow root level cannot be adapted to L1's NPT root
level and is instead always the TDP root level because NPT uses the
current host CR0/CR4/EFER, e.g. 64-bit KVM can't drop into 32-bit PAE to
shadow L1's NPT.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210622175739.3610207-20-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c