]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: mmu: fix is_tdp_mmu_check when the TDP MMU is not in use
authorPaolo Bonzini <pbonzini@redhat.com>
Sun, 15 Nov 2020 13:55:43 +0000 (08:55 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 15 Nov 2020 13:55:43 +0000 (08:55 -0500)
commita3f4618caa00c90839b511eeaa6a20b9ff2b0fff
tree4e9f2f5f5b1c8cd61dd59a6985159c4ff57ce479
parentdcfa24edd8e83a8e23b0bf650e6910f30f03e273
kvm: mmu: fix is_tdp_mmu_check when the TDP MMU is not in use

In some cases where shadow paging is in use, the root page will
be either mmu->pae_root or vcpu->arch.mmu->lm_root.  Then it will
not have an associated struct kvm_mmu_page, because it is allocated
with alloc_page instead of kvm_mmu_alloc_page.

Just return false quickly from is_tdp_mmu_root if the TDP MMU is
not in use, which also includes the case where shadow paging is
enabled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c