[PATCH v6 12/12] Send async PF when guest is not in userspace too.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Gleb Natapov
Date: Monday, October 4, 2010 - 8:56 am

If guest indicates that it can handle async pf in kernel mode too send
it, but only if interrupts are enabled.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 arch/x86/kvm/x86.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cad4412..30b1cd1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6244,7 +6244,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))
 			vcpu->arch.mp_state = KVM_MP_STATE_HALTED;
 		else if (!apf_put_user(vcpu, KVM_PV_REASON_PAGE_NOT_PRESENT)) {
 			vcpu->arch.fault.error_code = 0;
-- 
1.7.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v6 08/12] Handle async PF in a guest., Gleb Natapov, (Mon Oct 4, 8:56 am)
[PATCH v6 12/12] Send async PF when guest is not in usersp ..., Gleb Natapov, (Mon Oct 4, 8:56 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Avi Kivity, (Thu Oct 7, 6:10 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Gleb Natapov, (Thu Oct 7, 10:14 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Avi Kivity, (Thu Oct 7, 10:18 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Rik van Riel, (Thu Oct 7, 10:48 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Gleb Natapov, (Thu Oct 7, 11:03 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Avi Kivity, (Sat Oct 9, 11:48 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Gleb Natapov, (Sun Oct 10, 12:56 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Gleb Natapov, (Sun Oct 10, 5:32 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Avi Kivity, (Sun Oct 10, 5:38 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Avi Kivity, (Sun Oct 10, 5:40 am)
Re: [PATCH v6 08/12] Handle async PF in a guest., Gleb Natapov, (Sun Oct 10, 6:22 am)