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 7A3C930DD1D; Fri, 15 May 2026 16:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778860846; cv=none; b=gz3OWumdqmCd97Unu7T0K8hM5PmBGUr3hhC/fPR58YmmgBJbM5n2J5YkPcuNGq47wPj+NqV8sarerOmBOwiAd6Tnkxs6+Kx6UWRvqnysNWRvG9hj4I67lWAxI5pbpnz3ovDCnyDaGTEmfMmH8090ET00HDoe7Usy6ABYNDOlQKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778860846; c=relaxed/simple; bh=7F+sZSSB7Jba/NugLd3eFS42kBL8Pvt8wE0t8C1QKzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dNVDnDT4PNCfSQUPwI/px/afvt8COnfUHsxdBzub7rtbgcJOzrYbIKYO8OvXN52Qc8TJh9TfOqkrWZsitE5u5jXdVv/oUfucKu0nl4Wcz9ghhMBpe5eek9qEVYnccaP4fXN1JKve0xggv79kKDcJSVQdih9ECnNmJP6+sYqQELE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NNL2i8ih; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NNL2i8ih" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11813C2BCB0; Fri, 15 May 2026 16:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778860846; bh=7F+sZSSB7Jba/NugLd3eFS42kBL8Pvt8wE0t8C1QKzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NNL2i8ih2nRWZOvATTz4uQZp0XmKEWF0QkDTwVDgftUtMixQgv/wRcFymXyZlffdf jn3qxbtID1fMsS20lTugyKOTPGYsA0XF+RR3bZAvtuq6RqRlQnPOqIuUM99R5RepWF hTB1miK7qkUFJP1lP4FqyWejML220JTXHT/aXHAo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yosry Ahmed , Sean Christopherson Subject: [PATCH 6.6 100/474] KVM: nSVM: Ensure AVIC is inhibited when restoring a vCPU to guest mode Date: Fri, 15 May 2026 17:43:29 +0200 Message-ID: <20260515154717.201310467@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yosry Ahmed commit 24f7d36b824b65cf1a2db3db478059187b2a37b0 upstream. On nested VMRUN, KVM ensures AVIC is inhibited by requesting KVM_REQ_APICV_UPDATE, triggering a check of inhibit reasons, finding APICV_INHIBIT_REASON_NESTED, and disabling AVIC. However, when KVM_SET_NESTED_STATE is performed on a vCPU not in guest mode with AVIC enabled, KVM_REQ_APICV_UPDATE is not requested, and AVIC is not inhibited. Request KVM_REQ_APICV_UPDATE in the KVM_SET_NESTED_STATE path if AVIC is active, similar to the nested VMRUN path. Fixes: f44509f849fe ("KVM: x86: SVM: allow AVIC to co-exist with a nested guest running") Cc: stable@vger.kernel.org Signed-off-by: Yosry Ahmed Link: https://patch.msgid.link/20260224225017.3303870-1-yosry@kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/svm/nested.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -1774,6 +1774,9 @@ static int svm_set_nested_state(struct k svm->nested.force_msr_bitmap_recalc = true; + if (kvm_vcpu_apicv_active(vcpu)) + kvm_make_request(KVM_REQ_APICV_UPDATE, vcpu); + kvm_make_request(KVM_REQ_GET_NESTED_STATE_PAGES, vcpu); ret = 0; out_free: