Re: [PATCH 5.15.y 8/8] KVM: x86/mmu: Ensure hugepage is in by slot before checking max mapping level
From: Sean Christopherson
Date: Fri Jun 26 2026 - 15:11:58 EST
On Fri, Jun 26, 2026, Sasha Levin wrote:
> > - if (sp->role.direct && !kvm_is_reserved_pfn(pfn) &&
> > + if (sp->role.direct && is_gfn_in_memslot(slot, sp->gfn) &&
>
> This drops the !kvm_is_reserved_pfn(pfn) guard instead of adding
> is_gfn_in_memslot() alongside it. I think upstream could drop it only because
> a8ac499bb6ab ("KVM: x86/mmu: Don't require refcounted "struct page" to create
> huge SPTEs") rewrote host_pfn_mapping_level() to stop touching the struct page
> but that commit isn't in 5.15. Does it make sense?
Agreed, the kvm_is_reserved_pfn() should be kept for 5.15.