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 342473AF65B for ; Sun, 3 May 2026 12:12:42 +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=1777810362; cv=none; b=TYlgQ7vjjqZVB3pbd7v61no9pfdBiG9oYlv/bLRU4vkDJUxK+HcPy1e4R+/XNr839EJHeV0AhiMc90r5BR6Sxd6RElwkVrbGIFFOY8GaAZVNV0mioAq6fX+5nLsUkP67wwz+HAhAuKcRY25IN9LEceOjjTXyW0uPSpOJLbr0u0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777810362; c=relaxed/simple; bh=nFy8D65fqI9HTeJhH1v/lQbFcEDIzNIdAhmtO4zeap0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Cqxf03lk2lVRnvtkJn6OaEmICtRH7PCxKiWlyyL96z4YzhogBHQHX6mNaWxTGwhEr5xzzqtH115/DrbyuignTJ0CFRBxvhDGzuaOIiVFDm6YrCU9/JxyEzMVFYNRSIrNBfUSBaUj1Gh3QOnuBx6tNc0W8KNQtpMbGk3D8UKW3no= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0a41dnaX; 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="0a41dnaX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B2C2C2BCB4; Sun, 3 May 2026 12:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777810361; bh=nFy8D65fqI9HTeJhH1v/lQbFcEDIzNIdAhmtO4zeap0=; h=Subject:To:Cc:From:Date:From; b=0a41dnaXcQMMO3weEgaZxAfNoWtjaKJkZ9KfB+wEHIXZ7j5S9DlmAswPuVBWcphXC 1o2tnjxoFSi8Ne3ZKvUhMzyliHXAl635uWJyYNdpwMmmiuFBDRqrnNTXovbwG65x4B ppTRy/DAis28rutTt4JgpK6bSezQyILs0sG/FLZ4= Subject: FAILED: patch "[PATCH] KVM: nSVM: Avoid clearing VMCB_LBR in vmcb12" failed to apply to 6.6-stable tree To: yosry@kernel.org,seanjc@google.com Cc: From: Date: Sun, 03 May 2026 14:12:31 +0200 Message-ID: <2026050331-diving-escargot-dc80@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-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 . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x b53ab5167a81537777ac780bbd93d32613aa3bda # git commit -s git send-email --to '' --in-reply-to '2026050331-diving-escargot-dc80@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From b53ab5167a81537777ac780bbd93d32613aa3bda Mon Sep 17 00:00:00 2001 From: Yosry Ahmed Date: Tue, 3 Mar 2026 00:33:55 +0000 Subject: [PATCH] KVM: nSVM: Avoid clearing VMCB_LBR in vmcb12 svm_copy_lbrs() always marks VMCB_LBR dirty in the destination VMCB. However, nested_svm_vmexit() uses it to copy LBRs to vmcb12, and clearing clean bits in vmcb12 is not architecturally defined. Move vmcb_mark_dirty() to callers and drop it for vmcb12. This also facilitates incoming refactoring that does not pass the entire VMCB to svm_copy_lbrs(). Fixes: d20c796ca370 ("KVM: x86: nSVM: implement nested LBR virtualization") Cc: stable@vger.kernel.org Signed-off-by: Yosry Ahmed Link: https://patch.msgid.link/20260303003421.2185681-2-yosry@kernel.org Signed-off-by: Sean Christopherson diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 3e2841598a36..0a35c815f4d2 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -715,6 +715,7 @@ static void nested_vmcb02_prepare_save(struct vcpu_svm *svm, struct vmcb *vmcb12 } else { svm_copy_lbrs(vmcb02, vmcb01); } + vmcb_mark_dirty(vmcb02, VMCB_LBR); svm_update_lbrv(&svm->vcpu); } @@ -1231,10 +1232,12 @@ int nested_svm_vmexit(struct vcpu_svm *svm) kvm_make_request(KVM_REQ_EVENT, &svm->vcpu); if (unlikely(guest_cpu_cap_has(vcpu, X86_FEATURE_LBRV) && - (svm->nested.ctl.virt_ext & LBR_CTL_ENABLE_MASK))) + (svm->nested.ctl.virt_ext & LBR_CTL_ENABLE_MASK))) { svm_copy_lbrs(vmcb12, vmcb02); - else + } else { svm_copy_lbrs(vmcb01, vmcb02); + vmcb_mark_dirty(vmcb01, VMCB_LBR); + } svm_update_lbrv(vcpu); diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 543f9f3f966e..9b4f5a46d550 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -848,8 +848,6 @@ void svm_copy_lbrs(struct vmcb *to_vmcb, struct vmcb *from_vmcb) to_vmcb->save.br_to = from_vmcb->save.br_to; to_vmcb->save.last_excp_from = from_vmcb->save.last_excp_from; to_vmcb->save.last_excp_to = from_vmcb->save.last_excp_to; - - vmcb_mark_dirty(to_vmcb, VMCB_LBR); } static void __svm_enable_lbrv(struct kvm_vcpu *vcpu)