From patchwork Mon Nov 23 14:06:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 62189 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nANEDa9m019106 for ; Mon, 23 Nov 2009 14:13:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754563AbZKWOLo (ORCPT ); Mon, 23 Nov 2009 09:11:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754403AbZKWOLm (ORCPT ); Mon, 23 Nov 2009 09:11:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28404 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbZKWOJa (ORCPT ); Mon, 23 Nov 2009 09:09:30 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nANE9BNr024646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Nov 2009 09:09:11 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nANE7sAn000419; Mon, 23 Nov 2009 09:09:11 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 5F1FA18D477; Mon, 23 Nov 2009 16:06:08 +0200 (IST) 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 Subject: [PATCH v2 12/12] Send async PF when guest is not in userspace too. Date: Mon, 23 Nov 2009 16:06:07 +0200 Message-Id: <1258985167-29178-13-git-send-email-gleb@redhat.com> In-Reply-To: <1258985167-29178-1-git-send-email-gleb@redhat.com> References: <1258985167-29178-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 1225c31..a538d82 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2204,10 +2204,11 @@ int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gpa_t cr3, gva_t gva, static bool can_do_async_pf(struct kvm_vcpu *vcpu) { - if (!vcpu->arch.apf_data || kvm_event_needs_reinjection(vcpu)) + if (!vcpu->arch.apf_data || kvm_event_needs_reinjection(vcpu) || + !kvm_x86_ops->interrupt_allowed(vcpu)) return false; - return !!kvm_x86_ops->get_cpl(vcpu); + return true; } static int tdp_page_fault(struct kvm_vcpu *vcpu, gpa_t cr3, gva_t gpa,