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 81FBA79C0 for ; Wed, 30 Nov 2022 18:51:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08547C433C1; Wed, 30 Nov 2022 18:51:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669834310; bh=pdTzps9UqRVl9daPs67KLsC1Lyk4trMv+f5paLHWHjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=thrhg+nvc9pPLWXfl0idO4rKxtwqDcFwDZqdwcIsx0Dj4JFUx0PXitfoi711bD+qc Hr8Q1opiO7Zd+dGW37JE2W/fWHatdDSlTmHN+LBsT4kQyWVS4iYm8euqlKu9T6rnNT Pk71WjVKzixRRB8BEIByDEmkzuP+HEtYS33f49tM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Maxim Levitsky , Paolo Bonzini Subject: [PATCH 6.0 207/289] KVM: x86: nSVM: leave nested mode on vCPU free Date: Wed, 30 Nov 2022 19:23:12 +0100 Message-Id: <20221130180548.812789144@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221130180544.105550592@linuxfoundation.org> References: <20221130180544.105550592@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 @@ -1440,6 +1440,7 @@ static void svm_vcpu_free(struct kvm_vcp */ svm_clear_current_vmcb(svm->vmcb); + svm_leave_nested(vcpu); svm_free_nested(svm); sev_free_vcpu(vcpu);