From patchwork Tue Sep 15 14:13:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 851F8C2D0E3 for ; Wed, 16 Sep 2020 00:15:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4172C20575 for ; Wed, 16 Sep 2020 00:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600215354; bh=g86pF/25NpGm1mtWcaNZILPae/tBhjShysjZpXKOlkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1eYwrDX/zLv/RYckI7zEthzigro0jRx0EyhOtteBPNibvDF1g6yvM2sgKVis9+O3k dDlvLxSXLhuCA0Qbay/LUMZNwLxT9IHiKoA3OkNHMyJAb8evPxAsLpfGc1mdeKwzCT oZoZKLlWsEaIheO9EpFvsNFm/h/XmxBMbA4irJ8I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727217AbgIPAPx (ORCPT ); Tue, 15 Sep 2020 20:15:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:37092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbgIOOYz (ORCPT ); Tue, 15 Sep 2020 10:24:55 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D572222C8; Tue, 15 Sep 2020 14:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179498; bh=g86pF/25NpGm1mtWcaNZILPae/tBhjShysjZpXKOlkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iguYI5mXjJo8SxCvGo1Ct50mrlQGJqHVzVRGxjzdYPlIkB34s1RozsI2cMWzBZhjB vnJt32dyFBScAKDnuDoTYNN3hxSTnWAkE7o61ITtX+j2RDDip1/9yXi+Ry68Um3WxW bUIXFDbFC8on6BUDEcgM4MYTvxr0VtdBkzockd+g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wanpeng Li , Paolo Bonzini Subject: [PATCH 4.19 68/78] KVM: VMX: Dont freeze guest when event delivery causes an APIC-access exit Date: Tue, 15 Sep 2020 16:13:33 +0200 Message-Id: <20200915140637.001545832@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wanpeng Li commit 99b82a1437cb31340dbb2c437a2923b9814a7b15 upstream. According to SDM 27.2.4, Event delivery causes an APIC-access VM exit. Don't report internal error and freeze guest when event delivery causes an APIC-access exit, it is handleable and the event will be re-injected during the next vmentry. Signed-off-by: Wanpeng Li Message-Id: <1597827327-25055-2-git-send-email-wanpengli@tencent.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -10128,6 +10128,7 @@ static int vmx_handle_exit(struct kvm_vc (exit_reason != EXIT_REASON_EXCEPTION_NMI && exit_reason != EXIT_REASON_EPT_VIOLATION && exit_reason != EXIT_REASON_PML_FULL && + exit_reason != EXIT_REASON_APIC_ACCESS && exit_reason != EXIT_REASON_TASK_SWITCH)) { vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV;