Re: [PATCH v3 2/3] KVM: x86: Drop superfluous caching of KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT
From: Xiaoyao Li
Date: Tue Apr 07 2026 - 10:07:44 EST
On 4/7/2026 6:53 AM, Sean Christopherson wrote:
Drop kvm_vcpu_arch.delivery_as_pf_vmexit and instead use msr_en_val as the
source of truth to reduce the probability of operating on stale data. This
fixes flaws where KVM fails to update delivery_as_pf_vmexit when APF is
explicitly disabled by the guest or implicitly disabled by KVM on INIT.
Absent other bugs, the flaws are benign as KVM *shouldn't* consume
delivery_as_pf_vmexit when PV APF support is disabled.
Simply delete the field, as there's zero benefit to maintaining a separate
"cache" of the state.
Fixes: 52a5c155cf79 ("KVM: async_pf: Let guest support delivery of async_pf from guest mode")
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Xiaoyao Li <xiaoyao.li@xxxxxxxxx>