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

From: Wanpeng Li
Date: Tue Jun 27 2017 - 18:49:36 EST


2017-06-27 21:19 GMT+08:00 Paolo Bonzini <pbonzini@xxxxxxxxxx>:
>
>
> 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);

Good point. :)

Regards,
Wanpeng Li