kvm: x86/mmu: Support disabling dirty logging for the tdp MMU
authorBen Gardon <bgardon@google.com>
Wed, 14 Oct 2020 18:26:56 +0000 (11:26 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 23 Oct 2020 07:42:14 +0000 (03:42 -0400)
commit14881998566d2dc0703870bbe063e8d42d780eb9
treec5fe7553fde8d6e1c9a73e2df9ba19daefb9aa47
parenta6a0b05da9f37ff56faa6b8351ed6e0b55032460
kvm: x86/mmu: Support disabling dirty logging for the tdp MMU

Dirty logging ultimately breaks down MMU mappings to 4k granularity.
When dirty logging is no longer needed, these granaular mappings
represent a useless performance penalty. When dirty logging is disabled,
search the paging structure for mappings that could be re-constituted
into a large page mapping. Zap those mappings so that they can be
faulted in again at a higher mapping level.

Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
machine. This series introduced no new failures.

This series can be viewed in Gerrit at:
https://linux-review.googlesource.com/c/virt/kvm/kvm/+/2538

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