Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754721Ab0AEORN (ORCPT ); Tue, 5 Jan 2010 09:17:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754551Ab0AEORG (ORCPT ); Tue, 5 Jan 2010 09:17:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62009 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754227Ab0AEONZ (ORCPT ); Tue, 5 Jan 2010 09:13:25 -0500 From: Gleb Natapov To: kvm@vger.kernel.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, avi@redhat.com, mingo@elte.hu, a.p.zijlstra@chello.nl, tglx@linutronix.de, hpa@zytor.com, riel@redhat.com, cl@linux-foundation.org Subject: [PATCH v3 12/12] Send async PF when guest is not in userspace too. Date: Tue, 5 Jan 2010 16:12:54 +0200 Message-Id: <1262700774-1808-13-git-send-email-gleb@redhat.com> In-Reply-To: <1262700774-1808-1-git-send-email-gleb@redhat.com> References: <1262700774-1808-1-git-send-email-gleb@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 964 Lines: 33 Signed-off-by: Gleb Natapov --- arch/x86/kvm/mmu.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9fd29cb..7945abf 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2204,7 +2204,13 @@ static bool can_do_async_pf(struct kvm_vcpu *vcpu) if (!vcpu->arch.apf_data || kvm_event_needs_reinjection(vcpu)) return false; - return !!kvm_x86_ops->get_cpl(vcpu); + if (vcpu->arch.apf_send_user_only) + return !!kvm_x86_ops->get_cpl(vcpu); + + if (!kvm_x86_ops->interrupt_allowed(vcpu)) + return false; + + return true; } static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa, u32 error_code, -- 1.6.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/