]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/MMU: Zap non-leaf SPTEs when disabling dirty logging
authorBen Gardon <bgardon@google.com>
Wed, 25 May 2022 23:09:04 +0000 (23:09 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jun 2022 15:28:49 +0000 (11:28 -0400)
commitdd42e0594c2d9cadd161df1d230f10e34f30120a
tree01a742d7f0caaa0f44d4564256bde24fa5c92aa7
parent3acd1e2908eccf3142f274c1ddc05a85de2d5293
KVM: x86/MMU: Zap non-leaf SPTEs when disabling dirty logging

Currently disabling dirty logging with the TDP MMU is extremely slow.
On a 96 vCPU / 96G VM backed with gigabyte pages, it takes ~200 seconds
to disable dirty logging with the TDP MMU, as opposed to ~4 seconds with
the shadow MMU.

When disabling dirty logging, zap non-leaf parent entries to allow
replacement with huge pages instead of recursing and zapping all of the
child, leaf entries. This reduces the number of TLB flushes required.
and reduces the disable dirty log time with the TDP MMU to ~3 seconds.

Opportunistically add a WARN() to catch GFNs that are mapped at a
higher level than their max level.

Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20220525230904.1584480-1-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_iter.c
arch/x86/kvm/mmu/tdp_iter.h
arch/x86/kvm/mmu/tdp_mmu.c