diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-09 02:49:47 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-02-25 08:20:18 -0500 |
commit | 5499ea73e7db5113bb6f60c9122495ddcd900940 (patch) | |
tree | b4e4a39bc8932aea6293f82e2700c6bd5dfd80ab /arch/x86/kvm/svm/nested.c | |
parent | 0c1c92f15f7600a03377e3211983f3571c08ad4b (diff) | |
download | linux-5499ea73e7db5113bb6f60c9122495ddcd900940.tar.gz linux-5499ea73e7db5113bb6f60c9122495ddcd900940.tar.bz2 linux-5499ea73e7db5113bb6f60c9122495ddcd900940.zip |
KVM: x86/mmu: look for a cached PGD when going from 32-bit to 64-bit
Right now, PGD caching avoids placing a PAE root in the cache by using the
old value of mmu->root_level and mmu->shadow_root_level; it does not look
for a cached PGD if the old root is a PAE one, and then frees it using
kvm_mmu_free_roots.
Change the logic instead to free the uncacheable root early.
This way, __kvm_new_mmu_pgd is able to look up the cache when going from
32-bit to 64-bit (if there is a hit, the invalid root becomes the least
recently used). An example of this is nested virtualization with shadow
paging, when a 64-bit L1 runs a 32-bit L2.
As a side effect (which is actually the reason why this patch was
written), PGD caching does not use the old value of mmu->root_level
and mmu->shadow_root_level anymore.
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm/nested.c')
0 files changed, 0 insertions, 0 deletions