From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E4FC79C1 for ; Wed, 30 Nov 2022 18:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6369C433D6; Wed, 30 Nov 2022 18:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669833606; bh=3C2evLwJp8RYVdmmaW/it9wtHBC9bZeNsmjCwKkBpIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W5ShP/wF2mwjJuzNJLSKVNcAlcYeziSiaSTkSW9KtBBEn2et9CxJ6Bz0TuBPRc6WA jAaaOyH4ehW6BinjkwycBYSKyBBDHKxe/FADiXbeL2dE2+oW2Lc/z/v6msYHThbjCD BXmAq+o2FRQDIY7MtWCFsFZp6Bs6rnM/iX1d8hJY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maxim Levitsky , Paolo Bonzini Subject: [PATCH 5.15 156/206] KVM: x86: nSVM: leave nested mode on vCPU free Date: Wed, 30 Nov 2022 19:23:28 +0100 Message-Id: <20221130180537.003871916@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130180532.974348590@linuxfoundation.org> References: <20221130180532.974348590@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Maxim Levitsky commit 917401f26a6af5756d89b550a8e1bd50cf42b07e upstream. If the VM was terminated while nested, we free the nested state while the vCPU still is in nested mode. Soon a warning will be added for this condition. Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20221103141351.50662-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/svm/svm.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1427,6 +1427,7 @@ static void svm_free_vcpu(struct kvm_vcp */ svm_clear_current_vmcb(svm->vmcb); + svm_leave_nested(vcpu); svm_free_nested(svm); sev_free_vcpu(vcpu);