Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp862052ybz; Fri, 24 Apr 2020 10:28:27 -0700 (PDT) X-Google-Smtp-Source: APiQypLdHf4C2CgrGrrsEjLm/qL3gVcW4I6RMplWAgHu6Lj8bHLRCUpRd1IwYHzqKX6PUjhfvfy1 X-Received: by 2002:a17:906:4c46:: with SMTP id d6mr8008568ejw.257.1587749307803; Fri, 24 Apr 2020 10:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587749307; cv=none; d=google.com; s=arc-20160816; b=JdIuQPY/EMibqMvvotIiqbBmE80964AjROvFkeJd7OmPajJdC9u7+dbdzCvsRFgIjM aBhRXnehiF9C4oJyjkh9kAzk9MDlgMCCGYzAGR0pNTqHAElANiy8u+YUG9N/3Ok/azIb nTVWvMbE7kO+t3P+o185NzTd7KFkhyE8rRLVST5n4v9QHbrKSXDM/gsFn5eGChClYs2k 56VrG9cJm+THYpTseViXl2qmU+ZNekI+dCz+QMTNnuNi4cj0e1CWBZtqiU23V2f6YgMC Qz4UOkatCiadnW684z9EeSCvl0s+PLnEyYeNf0st7UbmGSOQB0EHP3iqm/gAfogSutbp +2Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=X97kAjQTRE8bXr/jYZHHtAlVVl/dgOHFGA/rfX34Hrg=; b=z9WNosBAYYsv95OHue/2gtUHNrLxXRrK8iaQrUCFeTN8ryWy6WieTBba+wZkWs7i/6 aQD8WrUCwZbqIYn/FBNnpbsBYIONlsUxPAZ0bA2T04PK0xRNADkDq0txAUbF3r1njzSB Xb1DBeV+DFJfhdnq/ZNet1LwdpthC2sXx4anL6UfUGDC267thmxZH0nAvv4yERvLFNmZ uhz+vRF1jEAB9fsDEVbOQ2vYRxPlouaZ3bKnFMnRSYPNd95BNwkoX70meddWIqJXV06c 0Yngo3PIupMsaIx9uGhqy3kxLIgfOCkn4xG0KwvNNN0vhCYyF+pP6KXa7iOQKYn9VGcI gbAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AuKC80ju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si3372493eju.18.2020.04.24.10.28.04; Fri, 24 Apr 2020 10:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AuKC80ju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728508AbgDXRYf (ORCPT + 99 others); Fri, 24 Apr 2020 13:24:35 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:33916 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727022AbgDXRYf (ORCPT ); Fri, 24 Apr 2020 13:24:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587749074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=X97kAjQTRE8bXr/jYZHHtAlVVl/dgOHFGA/rfX34Hrg=; b=AuKC80jujjCWoSIgs8rVvQVsANFvUEjYVj8agd+E9XaioG6I8ck9vQsaUYLVCndcpHKx1m M5XDwigbpWB9qeOgU0L9Q8XzFnu9AR49QKCG+GmuzLJhpFGNu6eCjtrsA+qrxJ0viZ02m8 uqkHOUjjfFnv5Rxa9Ubz7uQ8oYrif0U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-63-nv8tM_YhPBWV5WT-sDK--g-1; Fri, 24 Apr 2020 13:24:32 -0400 X-MC-Unique: nv8tM_YhPBWV5WT-sDK--g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B73D353; Fri, 24 Apr 2020 17:24:20 +0000 (UTC) Received: from virtlab511.virt.lab.eng.bos.redhat.com (virtlab511.virt.lab.eng.bos.redhat.com [10.19.152.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id CEAA525277; Fri, 24 Apr 2020 17:24:19 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: wei.huang2@amd.com, cavery@redhat.com, vkuznets@redhat.com, Sean Christopherson , Oliver Upton , Jim Mattson Subject: [PATCH v2 02/22] KVM: SVM: leave halted state on vmexit Date: Fri, 24 Apr 2020 13:23:56 -0400 Message-Id: <20200424172416.243870-3-pbonzini@redhat.com> In-Reply-To: <20200424172416.243870-1-pbonzini@redhat.com> References: <20200424172416.243870-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Similar to VMX, we need to leave the halted state when performing a vmexit. Failure to do so will cause a hang after vmexit. Signed-off-by: Paolo Bonzini --- arch/x86/kvm/svm/nested.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 51cfab68428d..e69e60ac1370 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -472,6 +472,9 @@ int nested_svm_vmexit(struct vcpu_svm *svm) leave_guest_mode(&svm->vcpu); svm->nested.vmcb = 0; + /* in case we halted in L2 */ + svm->vcpu.arch.mp_state = KVM_MP_STATE_RUNNABLE; + /* Give the current vmcb to the guest */ disable_gif(svm); -- 2.18.2