]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86/mmu: Wrap sanity check on number of TDP MMU pages with KVM_PROVE_MMU
authorSean Christopherson <seanjc@google.com>
Sat, 15 Mar 2025 02:34:48 +0000 (19:34 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 4 Apr 2025 11:07:40 +0000 (07:07 -0400)
commit81d480fdf8b7d9b13fe87e1f0516f89794708094
treedc764547bbd6d5dfbc2177c1c61cd7ea785058e4
parent0297cdc12a87629ad904ac8c0630f7702f9a2d48
KVM: x86/mmu: Wrap sanity check on number of TDP MMU pages with KVM_PROVE_MMU

Wrap the TDP MMU page counter in CONFIG_KVM_PROVE_MMU so that the sanity
check is omitted from production builds, and more importantly to remove
the atomic accesses to account pages.  A one-off memory leak in production
is relatively uninteresting, and a WARN_ON won't help mitigate a systemic
issue; it's as much about helping triage memory leaks as it is about
detecting them in the first place, and doesn't magically stop the leaks.
I.e. production environments will be quite sad if a severe KVM bug escapes,
regardless of whether or not KVM WARNs.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20250315023448.2358456-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/tdp_mmu.c