Re: [PATCH 06/17] KVM: x86/tdp_mmu: Morph the !is_frozen_spte() check into a KVM_MMU_WARN_ON()

From: Edgecombe, Rick P

Date: Tue Mar 31 2026 - 12:54:37 EST


On Mon, 2026-03-30 at 13:00 +0800, Yan Zhao wrote:

Yep on the typos.

> > --- a/arch/x86/kvm/mmu/tdp_mmu.c
> > +++ b/arch/x86/kvm/mmu/tdp_mmu.c
> > @@ -656,7 +656,13 @@ static inline int __must_check
> > __tdp_mmu_set_spte_atomic(struct kvm *kvm,
> >    */
> >    WARN_ON_ONCE(iter->yielded || is_frozen_spte(iter-
> > >old_spte));
> >  
> > - if (is_mirror_sptep(iter->sptep) &&
> > !is_frozen_spte(new_spte)) {
> > + /*
> > + * FROZEN_SPTE is a temporary state and should never be
> > set via higher
> > + * level helpers.
> > + */
> > + KVM_MMU_WARN_ON(is_frozen_spte(new_spte));
> Why is KVM_MMU_WARN_ON() used here for new_spte while WARN_ON_ONCE()
> is used
> above for old_spte?

For the KVM_MMU_WARN_ON() it was Sean's suggestion.

https://lore.kernel.org/lkml/aYYn0nf2cayYu8e7@xxxxxxxxxx/

It allows for compiling it out, so probably a better choice. So I see
the options are leave them different or opportunistically convert the
other one to KVM_MMU_WARN_ON(). Thoughts?