KVM: x86/mmu: Expand and clean up page fault stats
authorSean Christopherson <seanjc@google.com>
Sat, 23 Apr 2022 03:47:49 +0000 (03:47 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 12 May 2022 13:51:43 +0000 (09:51 -0400)
commit1075d41efd598d3fd4d52a1e1116b20979975135
tree4ab75f1e4e2f0893dd209e8dc8894d06ec7ebdee
parent8d5265b1016369836c0735ed40933e179f186630
KVM: x86/mmu: Expand and clean up page fault stats

Expand and clean up the page fault stats.  The current stats are at best
incomplete, and at worst misleading.  Differentiate between faults that
are actually fixed vs those that result in an MMIO SPTE being created,
track faults that are spurious, faults that trigger emulation, faults
that that are fixed in the fast path, and last but not least, track the
number of faults that are taken.

Note, the number of faults that require emulation for write-protected
shadow pages can roughly be calculated by subtracting the number of MMIO
SPTEs created from the overall number of faults that trigger emulation.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220423034752.1161007-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h
arch/x86/kvm/mmu/paging_tmpl.h
arch/x86/kvm/mmu/tdp_mmu.c
arch/x86/kvm/x86.c