[PATCH v2] KVM: Ignore MMU notifiers for guest_memfd-only memslots

Alexandru Elisei alexandru.elisei at arm.com
Wed Aug 12 02:42:50 PDT 2026


Hi Sean,

(Sorry for the silence, was on holiday)

On Fri, Jul 24, 2026 at 12:52:20PM -0700, Sean Christopherson wrote:
> On Tue, Jul 14, 2026, Alexandru Elisei wrote:
> > +	 * TODO: Skip gmem-only memslots on mmu_notifier events entirely, once
> > +	 * gfn_to_pfn_cache is also wired up to directly pull from guest_memfd.
> 
> So it turns out we need to solve a very related problem[*], thanks to commit
> b9220d32799a ("KVM: x86/xen: allow shared_info to be mapped by fixed HVA"),
> which as it says, allows populating gfn_to_pfn_cache directly with an HVA, i.e.
> without a memslot.
> 
> My not-yet-tested solution for that mess is to give gfn_to_pfn_cache its own
> invalidation sequence, at which point there shouldn't be a need to process
> gmem-only memslots just for gfn_to_pfn_cache, because it will already be equipped
> to handle memslot-less invalidation.
> 
> Given how simple this change *should* be, I'm going to put this patch on the
> backburner for now, and then assuming my proposed change actually works, I'll
> grab your original change (or more likely, re-post it as the last patch in the
> series weans gfn_to_pfn_cache off mmu_invalidate_seq).

By "original change" I assume you mean the RFC patch [1], where I skip the
memslot entirely in handle_hva_range(), which would make sense since the
problem you are solving involves cache entries without a memslot.

[1] https://lore.kernel.org/kvm/20260615155244.183044-1-alexandru.elisei@arm.com/

> 
> It'll probably take me a few weeks to circle back to this, as I finally crawled
> out from underneath a pile of urgent and am just now getting back into review
> mode, but this is fairly high on my todo list, so with luck we might still squeeze
> this into 7.3.

Sounds great to me, thank you for your time and patience!

Alex

> 
> [*] https://lore.kernel.org/all/aj2hi-NcqUUCaoQF@google.com



More information about the linux-arm-kernel mailing list