Message ID | 20220207155447.840194-5-mlevitsk@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kvm-owner@kernel.org> 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 BCA99C47082 for <kvm@archiver.kernel.org>; Mon, 7 Feb 2022 16:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442431AbiBGQEf (ORCPT <rfc822;kvm@archiver.kernel.org>); Mon, 7 Feb 2022 11:04:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381154AbiBGPzh (ORCPT <rfc822;kvm@vger.kernel.org>); Mon, 7 Feb 2022 10:55:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A05C6C0401CF for <kvm@vger.kernel.org>; Mon, 7 Feb 2022 07:55:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644249335; 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=va2Nt/crWYOdjbL3kQd/XU5O6mMNd0LbnQBpM4oG1KI=; b=d8pbV2fMdertdfphG6AP7qKTwaJTu9j7UiwC8i6L9X9SM6eEbGHTUB8N9jYlLsQPlD25UD lv8T11tQmsC/ljgDlrakyUVKOwjYtzN039MbxJ5TumgLUzJJlMy+IB6JIOd3AYINzKBkPK Z6Amphf+rV/ehvNmnAUK6ai2LZFH4mI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-q1yrGdk1OXO_2Bn2pDEwxA-1; Mon, 07 Feb 2022 10:55:32 -0500 X-MC-Unique: q1yrGdk1OXO_2Bn2pDEwxA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4057F80F04E; Mon, 7 Feb 2022 15:55:29 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5AA4B7DE38; Mon, 7 Feb 2022 15:55:21 +0000 (UTC) From: Maxim Levitsky <mlevitsk@redhat.com> To: kvm@vger.kernel.org Cc: Tony Luck <tony.luck@intel.com>, "Chang S. Bae" <chang.seok.bae@intel.com>, Thomas Gleixner <tglx@linutronix.de>, Wanpeng Li <wanpengli@tencent.com>, Ingo Molnar <mingo@redhat.com>, Vitaly Kuznetsov <vkuznets@redhat.com>, Pawan Gupta <pawan.kumar.gupta@linux.intel.com>, Dave Hansen <dave.hansen@linux.intel.com>, Paolo Bonzini <pbonzini@redhat.com>, linux-kernel@vger.kernel.org, Rodrigo Vivi <rodrigo.vivi@intel.com>, "H. Peter Anvin" <hpa@zytor.com>, intel-gvt-dev@lists.freedesktop.org, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Joerg Roedel <joro@8bytes.org>, Sean Christopherson <seanjc@google.com>, David Airlie <airlied@linux.ie>, Zhi Wang <zhi.a.wang@intel.com>, Brijesh Singh <brijesh.singh@amd.com>, Jim Mattson <jmattson@google.com>, x86@kernel.org, Daniel Vetter <daniel@ffwll.ch>, Borislav Petkov <bp@alien8.de>, Zhenyu Wang <zhenyuw@linux.intel.com>, Kan Liang <kan.liang@linux.intel.com>, Jani Nikula <jani.nikula@linux.intel.com>, Maxim Levitsky <mlevitsk@redhat.com>, stable@vger.kernel.org Subject: [PATCH RESEND 04/30] KVM: x86: nSVM/nVMX: set nested_run_pending on VM entry which is a result of RSM Date: Mon, 7 Feb 2022 17:54:21 +0200 Message-Id: <20220207155447.840194-5-mlevitsk@redhat.com> In-Reply-To: <20220207155447.840194-1-mlevitsk@redhat.com> References: <20220207155447.840194-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: <kvm.vger.kernel.org> X-Mailing-List: kvm@vger.kernel.org |
Series |
My patch queue
|
expand
|
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 3f1d11e652123..71bfa52121622 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -4274,6 +4274,11 @@ static int svm_leave_smm(struct kvm_vcpu *vcpu, const char *smstate) nested_copy_vmcb_save_to_cache(svm, &vmcb12->save); ret = enter_svm_guest_mode(vcpu, vmcb12_gpa, vmcb12, false); + if (ret) + goto unmap_save; + + svm->nested.nested_run_pending = 1; + unmap_save: kvm_vcpu_unmap(vcpu, &map_save, true); unmap_map: diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 8ac5a6fa77203..fc9c4eca90a78 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7659,6 +7659,7 @@ static int vmx_leave_smm(struct kvm_vcpu *vcpu, const char *smstate) if (ret) return ret; + vmx->nested.nested_run_pending = 1; vmx->nested.smm.guest_mode = false; } return 0;
While RSM induced VM entries are not full VM entries, they still need to be followed by actual VM entry to complete it, unlike setting the nested state. This patch fixes boot of hyperv and SMM enabled windows VM running nested on KVM, which fail due to this issue combined with lack of dirty bit setting. Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Cc: stable@vger.kernel.org --- arch/x86/kvm/svm/svm.c | 5 +++++ arch/x86/kvm/vmx/vmx.c | 1 + 2 files changed, 6 insertions(+)