From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18C15C352A1 for ; Wed, 30 Nov 2022 12:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230222AbiK3MW2 (ORCPT ); Wed, 30 Nov 2022 07:22:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbiK3MW1 (ORCPT ); Wed, 30 Nov 2022 07:22:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7307A6F825 for ; Wed, 30 Nov 2022 04:22:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2B44EB81B2F for ; Wed, 30 Nov 2022 12:22:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D2C5C433D6; Wed, 30 Nov 2022 12:22:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669810943; bh=JILR1dvjHYvXtS0OyJDbqjoCfbPAtE/ufafof4vrdf4=; h=Subject:To:Cc:From:Date:From; b=lvJekdh/EPVsUgDfA871YD803SfqQK6YNNS5suyWh7guEBRkXEgdZ2aSGrITaq8iA JYGjwIkpgCamE6ADT62zI0EmRtnaIUcTXwA8JgMm9EvG9vD+rrbEpn73INdJ0LMvXO qrd9VCNqBedd6fyPw/KysxLr0MC8binhkFZBQ3ZM= Subject: FAILED: patch "[PATCH] KVM: x86: nSVM: leave nested mode on vCPU free" failed to apply to 5.4-stable tree To: mlevitsk@redhat.com, pbonzini@redhat.com Cc: From: Date: Wed, 30 Nov 2022 13:22:11 +0100 Message-ID: <166981093127207@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Possible dependencies: 917401f26a6a ("KVM: x86: nSVM: leave nested mode on vCPU free") 2fcf4876ada8 ("KVM: nSVM: implement on demand allocation of the nested state") 72f211ecaa80 ("KVM: x86: allow kvm_x86_ops.set_efer to return an error value") fd6fa73d1337 ("KVM: x86: SVM: Prevent MSR passthrough when MSR access is denied") 476c9bd8e997 ("KVM: x86: Prepare MSR bitmaps for userspace tracked MSRs") d85a8034c016 ("KVM: VMX: Rename "find_msr_entry" to "vmx_find_uret_msr"") eb3db1b13788 ("KVM: VMX: Rename the "shared_msr_entry" struct to "vmx_uret_msr"") ce833b2324ba ("KVM: VMX: Prepend "MAX_" to MSR array size defines") 7e34fbd05c63 ("KVM: x86: Rename "shared_msrs" to "user_return_msrs"") 8d22b90e942c ("KVM: SVM: refactor exit labels in svm_create_vcpu") 0681de1b8369 ("KVM: SVM: use __GFP_ZERO instead of clear_page") f4c847a95654 ("KVM: SVM: refactor msr permission bitmap allocation") 0dd16b5b0c9b ("KVM: nSVM: rename nested vmcb to vmcb12") 1feaba144cd3 ("KVM: SVM: rename a variable in the svm_create_vcpu") bf3c0e5e7102 ("Merge branch 'x86-seves-for-paolo' of https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into HEAD") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 917401f26a6af5756d89b550a8e1bd50cf42b07e Mon Sep 17 00:00:00 2001 From: Maxim Levitsky Date: Thu, 3 Nov 2022 16:13:43 +0200 Subject: [PATCH] KVM: x86: nSVM: leave nested mode on vCPU free 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 diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 9f88c8e6766e..098f04bec8ef 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1438,6 +1438,7 @@ static void svm_vcpu_free(struct kvm_vcpu *vcpu) */ svm_clear_current_vmcb(svm->vmcb); + svm_leave_nested(vcpu); svm_free_nested(svm); sev_free_vcpu(vcpu);