[PATCH 1/3] KVM: x86: Warn if KVM tries to deliver an #APF completion when APF is not enabled
From: Maxim Levitsky
Date: Wed Aug 13 2025 - 15:24:00 EST
KVM flushes the APF queue completely when the asynchronous pagefault is
disabled, therefore this case should not occur.
Signed-off-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a1c49bc681c4..9018d56b4b0a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -13466,7 +13466,7 @@ void kvm_arch_async_page_present_queued(struct kvm_vcpu *vcpu)
bool kvm_arch_can_dequeue_async_page_present(struct kvm_vcpu *vcpu)
{
- if (!kvm_pv_async_pf_enabled(vcpu))
+ if (WARN_ON_ONCE(!kvm_pv_async_pf_enabled(vcpu)))
return true;
else
return kvm_lapic_enabled(vcpu) && apf_pageready_slot_free(vcpu);
--
2.49.0