Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp73843pxb; Mon, 13 Sep 2021 13:18:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzsH3dYbF/zZOlDWlBh96RgfpCJc0jaOs1zXYQ+p6El1C3wYEYc52RU+uwnq2UL9kyAjo7 X-Received: by 2002:aa7:cdc8:: with SMTP id h8mr6328976edw.272.1631564288875; Mon, 13 Sep 2021 13:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631564288; cv=none; d=google.com; s=arc-20160816; b=JVYKYh+Gf3o3e9csoKyNCRAt3zwFvC//a0+WU9VUn/mSVWWCAytmFj0fmRioQL6U4J VtLAWuDsgVbRtoNL4JVFnwB8hX6GLunepM3mZC8sCRO7BCf6hskGA8s59bs2SvLN9BMb nC7ioBejSXvMxEs+4Zd4CIwX+J/EIDrK6iaePWRFpEP/Wd3H/B8rleVUBwX/KJ6F/0xz cbYi1FCg9QbtBBtOJQi//OUbM4qpbWME6nGkxRhZr9mJByMo2t4/q9KmkJkRgZpiVRR6 3IQ+MloNxVtPzm9TWm+/U4TjypoSFRpNulEe8vf/XMagui8nE0299yTJIxmgGQmAChNl Cgfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gj3BC6ns7n+KsB2mBBaY8ckBnOxnptFYFTxOuH+wtk4=; b=ofEZSCoDLeyz1n2KsRvRW+WfK73J7y57cOO6SJ8FN9mivKX1FB8rMDywUfDEHA3jYE CKcQfyIWPdQe/x0+DB3J9yX2I8ecitP1us7PxpuM2KbAOhKKwODwX8PUX+TNK/RTIwN8 3WWjnTcjG5oYrcjVfrYVFCVFzr2N4F+huB75bdNHo6W8p5SNYpgFM55xsAI0lZ3ssUJc Lc6njDZgjw+PnlraafgB+JKJrhs6Aizu58EW5NsUq14uPc2IuIjNCLB+MQe5934c5hRK TU8PpxXNxVROqMz8VKmTjzif/sUO5EZzBj7F4H0krQiWkXHBNRtUkMsbfXeYxqntRW0T +MtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qF906Qo/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si6528070eds.181.2021.09.13.13.17.45; Mon, 13 Sep 2021 13:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qF906Qo/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243373AbhIMNvw (ORCPT + 99 others); Mon, 13 Sep 2021 09:51:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:56792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244090AbhIMNrd (ORCPT ); Mon, 13 Sep 2021 09:47:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6196761288; Mon, 13 Sep 2021 13:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539952; bh=JJooFV/ryU/2X5VThW6kqQMdFjymF9VBm25fl68WEjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qF906Qo/N265eq2EQymJkDQxX/hP75m57Pflb6xe2ETE0tiWQnQbO3D+dFd5EOGus fV51nq0Liq8ZXDz6jCN/iyMptw/RNEiAc2BxZfkF0/SRjDGR0kAp/8s7iEv9KCUT6E khA4vVyVvumIv425XswL1V60I28UZeJzT3WymaSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Levitsky , Paolo Bonzini Subject: [PATCH 5.10 227/236] KVM: VMX: avoid running vmx_handle_exit_irqoff in case of emulation Date: Mon, 13 Sep 2021 15:15:32 +0200 Message-Id: <20210913131108.076522198@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxim Levitsky commit 81b4b56d4f8130bbb99cf4e2b48082e5b4cfccb9 upstream. If we are emulating an invalid guest state, we don't have a correct exit reason, and thus we shouldn't do anything in this function. Signed-off-by: Maxim Levitsky Message-Id: <20210826095750.1650467-2-mlevitsk@redhat.com> Cc: stable@vger.kernel.org Fixes: 95b5a48c4f2b ("KVM: VMX: Handle NMIs, #MCs and async #PFs in common irqs-disabled fn", 2019-06-18) Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/vmx/vmx.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -6396,6 +6396,9 @@ static void vmx_handle_exit_irqoff(struc { struct vcpu_vmx *vmx = to_vmx(vcpu); + if (vmx->emulation_required) + return; + if (vmx->exit_reason.basic == EXIT_REASON_EXTERNAL_INTERRUPT) handle_external_interrupt_irqoff(vcpu); else if (vmx->exit_reason.basic == EXIT_REASON_EXCEPTION_NMI)