KVM: Let host know whether the guest can handle async PF in non-userspace context.
If guest can detect that it runs in non-preemptable context it can handle async PFs at any time, so let host know that it can send async PF even if guest cpu is not in userspace. Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
@@ -449,6 +449,9 @@ void __cpuinit kvm_guest_cpu_init(void)
|
||||
if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) {
|
||||
u64 pa = __pa(&__get_cpu_var(apf_reason));
|
||||
|
||||
#ifdef CONFIG_PREEMPT
|
||||
pa |= KVM_ASYNC_PF_SEND_ALWAYS;
|
||||
#endif
|
||||
wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED);
|
||||
__get_cpu_var(apf_reason).enabled = 1;
|
||||
printk(KERN_INFO"KVM setup async PF for cpu %d\n",
|
||||
|
Reference in New Issue
Block a user