KVM: x86/mmu: only perform eager page splitting on valid roots
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 2 Mar 2022 13:44:22 +0000 (08:44 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 14:31:50 +0000 (09:31 -0500)
commit7c554d8e51a9cf5c0a142b4af825d96da67c57fa
tree900c26862faece0ed15fbca84d44f75254efe625
parent226b8c8f85e4246f31947be1c11bf36208fe9052
KVM: x86/mmu: only perform eager page splitting on valid roots

Eager page splitting is an optimization; it does not have to be performed on
invalid roots.  It is also the only case in which a reader might acquire
a reference to an invalid root, so after this change we know that readers
will skip both dying and invalid roots.

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