Re: [PATCH v5 4/4] KVM: async_pf: Let host know whether the guest support delivery async_pf as #PF vmexit

From: Paolo Bonzini
Date: Tue Jun 27 2017 - 09:20:08 EST




On 27/06/2017 03:47, Wanpeng Li wrote:
> - wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED);
> + pa |= KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT | KVM_ASYNC_PF_ENABLED;
> + wrmsr_safe(MSR_KVM_ASYNC_PF_EN, pa & 0xffffffff, pa >> 32);
> __this_cpu_write(apf_reason.enabled, 1);

Better:

pa |= KVM_ASYNC_PF_ENABLED;

/* Async page fault support for L1 hypervisor is optional. */
if (wrmsr_safe(MSR_KVM_ASYNC_PF_EN,
pa | KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT) < 0)
wrmsrl(MSR_KVM_ASYNC_PF_EN, pa);

Thanks,

Paolo