From patchwork Thu Oct 14 09:17:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: y@redhat.com X-Patchwork-Id: 252571 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9E9IsCp015894 for ; Thu, 14 Oct 2010 09:18:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755327Ab0JNJS3 (ORCPT ); Thu, 14 Oct 2010 05:18:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43651 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755263Ab0JNJSN (ORCPT ); Thu, 14 Oct 2010 05:18:13 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9E9HEj4031774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 14 Oct 2010 05:17:15 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o9E9HDRN026702; Thu, 14 Oct 2010 05:17:14 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id D408F133A08; Thu, 14 Oct 2010 11:17:10 +0200 (IST) From: y@redhat.com 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, mtosatti@redhat.com Subject: [PATCH v7 12/12] Send async PF when guest is not in userspace too. Date: Thu, 14 Oct 2010 11:17:10 +0200 Message-Id: <1287047830-2120-13-git-send-email-y> In-Reply-To: <1287047830-2120-1-git-send-email-y> References: <1287047830-2120-1-git-send-email-y> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Oct 2010 09:18:55 +0000 (UTC) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 1e442df..51cff2f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6248,7 +6248,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;