Re: [PATCH v2 0/4] KVM: x86/mmu: Fix pre-fault and map private loops

From: Sean Christopherson

Date: Mon Sep 21 2026 - 12:30:33 EST


On Mon, Sep 21, 2026, Paolo Bonzini wrote:
> On Mon, Sep 21, 2026 at 4:07 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
> >
> > On Wed, 26 Aug 2026 09:42:10 -0700, Sean Christopherson wrote:
> > > Fix a bug in the pre-fault path where KVM fails to reload an invalidated
> > > MMU root, which puts the KVM_PRE_FAULT_MEMORY task into an infinite loop
> > > (although it's breakable, so not fatal to the host). My best guess is that
> > > the test started failing once PREEMPT_LAZY was enabled by default. Note,
> > > the bug is *really* easy to repro with a to-be-proposed patch to have KVM
> > > do auto-pre-faulting[*], i.e. prefetch surrounding pages on fault.
> > >
> > > [...]
> >
> > Applied to kvm-x86 mmu, thanks!
> >
> > [1/4] KVM: x86/mmu: Reload MMU on *every* page pre-fault attempt/iteration
> > https://github.com/kvm-x86/linux/commit/355323a4dc94
> > [2/4] KVM: x86/mmu: Harden "map private PFN" against unexpected root invalidation
> > https://github.com/kvm-x86/linux/commit/698b8c88e159
> > [3/4] KVM: x86/mmu: Top-up memory caches when retrying "map private PFN"
> > https://github.com/kvm-x86/linux/commit/6415d9c4ee19
> > [4/4] KVM: x86/mmu: Add sanity check to detect stale page faults in "map private PFN"
> > https://github.com/kvm-x86/linux/commit/f7a3be227619
>
> Should I apply this to kvm/master?

I'm not opposed to pulling this into 7.3, but I also don't think it's necessary.
There's no danger to the host, and without the auto-pre-faulting functionality,
it effectively requires a deliberately misbehaving VMM. I doubt this will impact
anything other than the pre-fault selftest for 7.3.