diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-10-14 05:22:55 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-01-12 04:23:21 -0500 |
commit | 6adba527420651b6cacaf392541c09fb108711a2 (patch) | |
tree | 1f81e4fc0bdf46b39ed62587a493f085633e8ac1 /arch/x86/kernel | |
parent | 6c047cd982f944fa63b2d96de2a06463d113f9fa (diff) |
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>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/kvm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 47ea93e6b0d8..91b3d650898c 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
@@ -449,6 +449,9 @@ void __cpuinit kvm_guest_cpu_init(void) | |||
449 | if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { | 449 | if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { |
450 | u64 pa = __pa(&__get_cpu_var(apf_reason)); | 450 | u64 pa = __pa(&__get_cpu_var(apf_reason)); |
451 | 451 | ||
452 | #ifdef CONFIG_PREEMPT | ||
453 | pa |= KVM_ASYNC_PF_SEND_ALWAYS; | ||
454 | #endif | ||
452 | wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED); | 455 | wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED); |
453 | __get_cpu_var(apf_reason).enabled = 1; | 456 | __get_cpu_var(apf_reason).enabled = 1; |
454 | printk(KERN_INFO"KVM setup async PF for cpu %d\n", | 457 | printk(KERN_INFO"KVM setup async PF for cpu %d\n", |