Message ID | 20221020093055.224317-2-mlevitsk@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp19wrr; Thu, 20 Oct 2022 02:39:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48zHe0ZPAFeokJ/5RhlGtK5AxOobIo6EHDzaJb12CSLIDiK8J+G8GYVG349sjaXHlUJHUi X-Received: by 2002:a17:90b:224d:b0:20d:8828:3051 with SMTP id hk13-20020a17090b224d00b0020d88283051mr14622671pjb.89.1666258759417; Thu, 20 Oct 2022 02:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666258759; cv=none; d=google.com; s=arc-20160816; b=PyRKD5ZrwTyzMhYM+EDAqrTTnKFm7eGNlJqhhCIWIknhTFNPpt24j+dmCuBx+vRahw 4Lk9RA5QGiVA3rudY3gJLFE6jCUiklyUhNo1HoKYWwhTBQlPJAPrVVjrDVJ+8BNzqD4B M+BKvDFG5E1gHTwVR0iVQ9pzWZ/JFNNznaK1v0JmyjzOMwTpww3qtacSLyK/dwPi4IYG MhrzCKs+C4ZQV4iXy53gmc+T43tCqZUIf+wFW0/xicdbzaTud3OXVhp3fPN+PNgs6dM2 aAsRPH/Yt8VMBburZk5WBbknfznS4P0tVDM+hk17dJb0Ww1Ik6k+XSKdD7eTShir6zcS FaIg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IBgj4Fw1P4eekn5EviwqvOJ2K/YwxD/QOnBlpto11Zg=; b=0gJxopfNTc6wAmfcJy3FC2X5OZYpdYlnTHaUZbEgmb6fltXttZ3ES+6d1wzVVCsNp+ D4p+KtAgVkLzRbSSrBBrHSMwZjB1eRp9knfmy/3AX95P2OHSaHxL3GELOk6HNBTDv/1y UWQRu4vy+pa9XrT0Mty8e5agvmkG8bH9sZxOq+8jZkOefULUJO1pLeh8AKB7YqmwgpcG jUC96wzFMj7dyqk6cDt+EYVABZbCQKatQQWTeEQX94/XSVHwaXZJpUhSjrFgGKdpEghE C5f/LGaD31zZx5ij8Pz7Dnlv5xRWPL4OJmbWhgfv6JYo134KUob/rUQG2L6vhVhsLB3R df2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O5ryYTQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a170902e5c400b001846e0e0511si26656529plf.226.2022.10.20.02.39.05; Thu, 20 Oct 2022 02:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=O5ryYTQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbiJTJbY (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Thu, 20 Oct 2022 05:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbiJTJbQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Oct 2022 05:31:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B5C5156244 for <linux-kernel@vger.kernel.org>; Thu, 20 Oct 2022 02:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666258271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IBgj4Fw1P4eekn5EviwqvOJ2K/YwxD/QOnBlpto11Zg=; b=O5ryYTQqQFBNfUMm10Pk3t3HoJjEeHge5NrUTwo0znTPDz8j/EAYzNRkTohd1LCxhWowq9 qvMG6V6PJUgq1J3ugEi2luCC1P6f9isK2V6BZRYXv59NMeGtNXGcH23RerVdL3tOOI3dhN GDQSJna7TA9/bw0vI22y8TWlDNFCmxw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-_oUs1GGWOj61jsTPq0Yptw-1; Thu, 20 Oct 2022 05:31:08 -0400 X-MC-Unique: _oUs1GGWOj61jsTPq0Yptw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EA5885A583; Thu, 20 Oct 2022 09:31:08 +0000 (UTC) Received: from localhost.localdomain (ovpn-192-51.brq.redhat.com [10.40.192.51]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09EC149BB60; Thu, 20 Oct 2022 09:31:04 +0000 (UTC) From: Maxim Levitsky <mlevitsk@redhat.com> To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>, Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>, Sean Christopherson <seanjc@google.com>, x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com>, Maxim Levitsky <mlevitsk@redhat.com>, stable@vger.kernel.org Subject: [PATCH 1/4] KVM: x86: nSVM: leave nested mode on vCPU free Date: Thu, 20 Oct 2022 12:30:52 +0300 Message-Id: <20221020093055.224317-2-mlevitsk@redhat.com> In-Reply-To: <20221020093055.224317-1-mlevitsk@redhat.com> References: <20221020093055.224317-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747198944844364478?= X-GMAIL-MSGID: =?utf-8?q?1747198944844364478?= |
Series |
nSVM: fix L0 crash if L2 has shutdown condtion which L1 doesn't intercept
|
|
Commit Message
Maxim Levitsky
Oct. 20, 2022, 9:30 a.m. UTC
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 <mlevitsk@redhat.com>
---
arch/x86/kvm/svm/svm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 58f0077d935799..958faa8807f52b 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1439,6 +1439,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);