Received: by 10.223.185.116 with SMTP id b49csp2319480wrg; Thu, 15 Feb 2018 09:46:56 -0800 (PST) X-Google-Smtp-Source: AH8x227EDIgj0b59eOGUSuOmjDQfJZ3AWTDkmckvF7UE9GHdyUwQsbZQwKBqBc+yS6V8DEf8x2Uh X-Received: by 10.99.97.81 with SMTP id v78mr2832965pgb.243.1518716816568; Thu, 15 Feb 2018 09:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518716816; cv=none; d=google.com; s=arc-20160816; b=e130QPztyfNlhWSAf7YiafrCHAJQH4tfT1YUVukqCeReCAuG14cjei7HjwE8cdfP4D hSYq89TC7MvaQvHnsr5Dhxhw9BcyZ3/vheRVyIceyOUY4lc16RVCiSy0POtXPkyaFeR1 Y2o2RL8kR79OkbxHEoz4zKwluAljcu0jDe1rK5/w1LVT7zESBq7xojDn0eLPROEm2yy5 JEOuUTAd//5hOFcpcjzwRK9iCAyPI7RPrpR0roUBEgNDKOIFBalH52rtEJdVmYGvY8Xp FexMK6ScQS/qn0rRL16oci4lHUHOQTmi1AmQxqqQ1ku5MV4yVXcLJ9G/YA8Txn7r7DJF s5Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=v0sSDV5B+gn5GbMgmhDOMWg92FxhvJ+kBppV13C+avs=; b=AlEql0Re7xT1JlpuvYJvfXKgt3HhApTU3e/aaDNI/Y3THdWs5krJ8DBBX5JMI0lnWn Ozug38lYJlnClQ1xn73IeandBCqpb0fWPl4eit0EZ9k8pXC72D1f1smQtIht7DhHicwD V50eGdRwP/XnqJs3qL456/CBFRyziyMl93GvGv2f/ZHmWJpgcQ0r43rlL1JtZn2Mkqop byns+lR2qTKEvPMEjrYEjg8RWaTyByATGj/uR9iepvDg8jWiNnKst+ALA36IA7SE3n9S RwoVXD+E3UeLYXt9yFH0X7sG4zCw0gh3y2VXDNc/fPrWjxvQho/cySB9guRx9AeY+pHy 3DPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si1316725pgp.421.2018.02.15.09.46.39; Thu, 15 Feb 2018 09:46:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164479AbeBOPbo (ORCPT + 99 others); Thu, 15 Feb 2018 10:31:44 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:56040 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164416AbeBOPbm (ORCPT ); Thu, 15 Feb 2018 10:31:42 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 070EAEC4; Thu, 15 Feb 2018 15:31:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ross Zwisler , Alec Blayne , Haozhong Zhang , Paolo Bonzini Subject: [PATCH 4.14 012/195] KVM MMU: check pending exception before injecting APF Date: Thu, 15 Feb 2018 16:15:03 +0100 Message-Id: <20180215151706.351835188@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Haozhong Zhang commit 2a266f23550be997d783f27e704b9b40c4010292 upstream. For example, when two APF's for page ready happen after one exit and the first one becomes pending, the second one will result in #DF. Instead, just handle the second page fault synchronously. Reported-by: Ross Zwisler Message-ID: Reported-by: Alec Blayne Signed-off-by: Haozhong Zhang Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -3784,7 +3784,8 @@ static int kvm_arch_setup_async_pf(struc bool kvm_can_do_async_pf(struct kvm_vcpu *vcpu) { if (unlikely(!lapic_in_kernel(vcpu) || - kvm_event_needs_reinjection(vcpu))) + kvm_event_needs_reinjection(vcpu) || + vcpu->arch.exception.pending)) return false; if (!vcpu->arch.apf.delivery_as_pf_vmexit && is_guest_mode(vcpu))