FAILED: patch "[PATCH] KVM: nSVM: Avoid clearing VMCB_LBR in vmcb12" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-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 <[email protected]>.
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.1.y
git checkout FETCH_HEAD
git cherry-pick -x b53ab5167a81537777ac780bbd93d32613aa3bda
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026050332-overdrive-street-d372@gregkh' --subject-prefix 'PATCH 6.1.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 <[email protected]>
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().
arch/x86/kvm/svm/nested.c +5 -2
@@ -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);
arch/x86/kvm/svm/svm.c +0 -2
@@ -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)