Re: [PATCH 0/2] KVM: x86: Fix lost nested APF VM-Exits
From: Sean Christopherson
Date: Fri Oct 02 2026 - 17:11:57 EST
On Fri, 02 Oct 2026 05:41:43 +0000, Loc Nguyen wrote:
> A nested asynchronous page fault delivered to L1 as a synthetic #PF
> VM-Exit can be lost after KVM queues the exception. Most callers of
> kvm_queue_exception_vmexit() arrive through kvm_multiple_exception(),
> which requests event processing, but the nested APF path calls the
> helper directly.
>
> Without KVM_REQ_EVENT, vcpu_enter_guest() can skip
> kvm_check_and_inject_events() and re-enter L2. A later VM-Exit can then
> clear the pending exception while reconstructing vectoring state. The
> APF reason remains PAGE_NOT_PRESENT, allowing a later regular #PF to
> consume the stale reason.
>
> [...]
Applied the fix to kvm-x86 misc. I'm going to hold off on the selftest for
the moment, I'd like to go straight to having it support both AMD and Intel.
Thanks!
[1/2] KVM: x86: Request event processing for exception VM-Exits
https://github.com/kvm-x86/linux/commit/88b23a2e8286
[2/2] KVM: selftests: Add a test for lost nested APF VM-Exits
[SKIP, for now]
--
https://github.com/kvm-x86/linux/tree/next