[PATCH 0/2] KVM: remove the dummy allocation case from async page fault handling

From: Paolo Bonzini

Date: Tue Nov 03 2026 - 10:53:58 EST


Asynchronous page fault handling is supposedly able to detect page
ready notifications that are sent before the waiter is registered,
but this code is broken for PREEMPT_RT because it tries to allocate in
hardirq-disabled context.

This code however is almost dead, because page ready notification will
happen on the same vCPU as the waiter and not until after the waiter
enables interrupts. Outside guest mode, interrupts are only enabled once
the waiter has registered itself, and this guarantees that an outstanding
(non-spurious) waiter will always be found. This unfortunately is not
the case for asynchronous page faults that are delivered while in guest
mode, but that can be fixed and the dubious code removed.

Paolo

Paolo Bonzini (2):
KVM: register asynchronous page fault waits with interrupts disabled
x86: KVM: remove the dummy allocation case from async page fault
handling

arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/include/asm/kvm_para.h | 20 ++++++-
arch/x86/kernel/kvm.c | 97 +++++++++------------------------
arch/x86/kvm/mmu.h | 14 +++++
arch/x86/kvm/mmu/mmu.c | 4 +-
arch/x86/kvm/svm/svm.c | 3 +-
arch/x86/kvm/vmx/main.c | 2 +-
7 files changed, 65 insertions(+), 76 deletions(-)

--
2.56.0