Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1875212pxb; Mon, 13 Sep 2021 07:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxi6q3HNZ7BkdBaJUlpo9FDarQKMq5eOPE0hhuk+A0nvaum9MDpEVwEOsufL2nC8kLq1uXc X-Received: by 2002:a02:a10b:: with SMTP id f11mr10065746jag.16.1631542875175; Mon, 13 Sep 2021 07:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631542875; cv=none; d=google.com; s=arc-20160816; b=ys7Uz5U34JauS5D2sHmjwS1R24RHs2Yxb9+ZkTwqtzH4QEYce+vcUmARFTrcqkgZkG kCKf1VNajTMf+x6nYAyrOsz0FLrAglDbv+nwUNJ17gUk8g1rCptEa5mn+294biOm3VYl h9B+nUZR9b+zGnVsEXOWmg+9FdGUw3783nMFdxST4xi+fZoXMlNZ38GpE0hIVXTKG6vq XeR+l93Jn1mLLCnCwGQk5HXUwDsxCgYUr/BaY84xlS7gzLvICfwh7dnZjJLPU9TtVbfN 8GCLvC94zwZVbFmCj62fUlujcYTimHFkXTX3SlBCFOxR7jEH2ck74O/p51OJeO4ppz24 ZbwQ== 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=onJC4AFxvnvA6kXuD9gxsC2AW/0LaH3uEJFap8xPEcQ=; b=nfxQcvvl69a87qS0JHbU7rqU/p7X5ZyvzI3CRq2f1OpNFIhfpoxLmGqBc5wVVrvfyF satKBfZbUQm/C7prm2VaaEzWkhAEMZfbyoZrLT9cmPNKNMYmFg92roBN72cHsbOdGilp SSJ2iivhqAQQNHVuxYFBd49o78lUH3g01UaH2N9Yd8IWtluBk9pG91LKSTR5ZTOzjAdZ oHb+mC2gY7OE7yIPi7XTkGI9Vo3h13hPBAfeyqIKHOoN0zE1ftmqAEKi9NEvUwsYiA4x rZzUw9fQilj/cn0Pmuj6imV8aPxzZXrTa/NJZmouPTVeScAKlG0VSA5Y1cLBIEYjRMm1 Ethg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=F9zc0Pr8; 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 t6si3962755ilj.70.2021.09.13.07.21.02; Mon, 13 Sep 2021 07:21:15 -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=F9zc0Pr8; 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 S242081AbhIMOUr (ORCPT + 99 others); Mon, 13 Sep 2021 10:20:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:39370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345155AbhIMOQe (ORCPT ); Mon, 13 Sep 2021 10:16:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A516E61350; Mon, 13 Sep 2021 13:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540664; bh=DD5nnO38FCLZjIbA3ZhYrcXfq5s3TPjAbFEF1cGkL40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9zc0Pr8ngaS2oJRGigniLzTkmMeZxKMqj2rAe5J7RE4ZQhYChwttZz4RxbvE63PE ztXGSPRWPwOy1DBSwcqGv2mP+hXXcCtQ7Gqn6IzB6FG/FauHX8u6s7BGZMYNmNMU4z yJkIrP0v+XRV/lW7w2Z8vELviStAxI8XQuLXAc0E= 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.13 285/300] KVM: VMX: avoid running vmx_handle_exit_irqoff in case of emulation Date: Mon, 13 Sep 2021 15:15:46 +0200 Message-Id: <20210913131118.967509925@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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 @@ -6452,6 +6452,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)