aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-10-14 11:22:56 +0200
committerAvi Kivity <avi@redhat.com>2011-01-12 11:23:22 +0200
commitfc5f06fac6fb8ce469ea173370f2cd398f1d9f9a (patch)
tree0f2017dabbfab067a5de8fdfdbc655be7a985388
parent6adba527420651b6cacaf392541c09fb108711a2 (diff)
downloadkernel_samsung_smdk4412-fc5f06fac6fb8ce469ea173370f2cd398f1d9f9a.zip
kernel_samsung_smdk4412-fc5f06fac6fb8ce469ea173370f2cd398f1d9f9a.tar.gz
kernel_samsung_smdk4412-fc5f06fac6fb8ce469ea173370f2cd398f1d9f9a.tar.bz2
KVM: Send async PF when guest is not in userspace too.
If guest indicates that it can handle async pf in kernel mode too send it, but only if interrupts are enabled. Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--arch/x86/kvm/x86.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index fff70b5..c0bd2a2 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6263,7 +6263,8 @@ void kvm_arch_async_page_not_present(struct kvm_vcpu *vcpu,
kvm_add_async_pf_gfn(vcpu, work->arch.gfn);
if (!(vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED) ||
- kvm_x86_ops->get_cpl(vcpu) == 0)
+ (vcpu->arch.apf.send_user_only &&
+ kvm_x86_ops->get_cpl(vcpu) == 0))
kvm_make_request(KVM_REQ_APF_HALT, vcpu);
else if (!apf_put_user(vcpu, KVM_PV_REASON_PAGE_NOT_PRESENT)) {
vcpu->arch.fault.error_code = 0;