summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2024-10-31 10:06:33 -0700
committerSean Christopherson <seanjc@google.com>2024-11-04 18:37:18 -0800
commit38b0ac47169b981bd40226f16f17d8a098c81309 (patch)
treee4cc17c57a82a3b8e0b21e79b1ce377b254dd1bd /arch/x86/kvm
parente287e43167139a6c644ba648be6b2bf39314eaae (diff)
downloadlinux-stable-38b0ac47169b981bd40226f16f17d8a098c81309.tar.gz
linux-stable-38b0ac47169b981bd40226f16f17d8a098c81309.tar.bz2
linux-stable-38b0ac47169b981bd40226f16f17d8a098c81309.zip
KVM: x86/mmu: Demote the WARN on yielded in xxx_cond_resched() to KVM_MMU_WARN_ON
Convert the WARN in tdp_mmu_iter_cond_resched() that the iterator hasn't already yielded to a KVM_MMU_WARN_ON() so the code is compiled out for production kernels (assuming production kernels disable KVM_PROVE_MMU). Checking for a needed reschedule is a hot path, and KVM sanity checks iter->yielded in several other less-hot paths, i.e. the odds of KVM not flagging that something went sideways are quite low. Furthermore, the odds of KVM not noticing *and* the WARN detecting something worth investigating are even lower. Link: https://lore.kernel.org/r/20241031170633.1502783-3-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/mmu/tdp_mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index 8170b16b91c3..ef44dcba1ecb 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -656,7 +656,7 @@ static inline bool __must_check tdp_mmu_iter_cond_resched(struct kvm *kvm,
struct tdp_iter *iter,
bool flush, bool shared)
{
- WARN_ON_ONCE(iter->yielded);
+ KVM_MMU_WARN_ON(iter->yielded);
if (!need_resched() && !rwlock_needbreak(&kvm->mmu_lock))
return false;