* FAILED: patch "[PATCH] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN" failed to apply to 5.15-stable tree
@ 2025-12-29 14:36 gregkh
2025-12-31 14:39 ` [PATCH 5.15.y] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN Sasha Levin
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2025-12-29 14:36 UTC (permalink / raw)
To: jmattson, seanjc; +Cc: stable
The patch below does not apply to the 5.15-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 <stable@vger.kernel.org>.
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-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 7c8b465a1c91f674655ea9cec5083744ec5f796a
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2025122929-riveter-outreach-a5e9@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7c8b465a1c91f674655ea9cec5083744ec5f796a Mon Sep 17 00:00:00 2001
From: Jim Mattson <jmattson@google.com>
Date: Mon, 22 Sep 2025 09:29:23 -0700
Subject: [PATCH] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN
Mark the VMCB_NPT bit as dirty in nested_vmcb02_prepare_save()
on every nested VMRUN.
If L1 changes the PAT MSR between two VMRUN instructions on the same
L1 vCPU, the g_pat field in the associated vmcb02 will change, and the
VMCB_NPT clean bit should be cleared.
Fixes: 4bb170a5430b ("KVM: nSVM: do not mark all VMCB02 fields dirty on nested vmexit")
Cc: stable@vger.kernel.org
Signed-off-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20250922162935.621409-3-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index 35cea27862c6..83de3456df70 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -613,6 +613,7 @@ static void nested_vmcb02_prepare_save(struct vcpu_svm *svm, struct vmcb *vmcb12
struct kvm_vcpu *vcpu = &svm->vcpu;
nested_vmcb02_compute_g_pat(svm);
+ vmcb_mark_dirty(vmcb02, VMCB_NPT);
/* Load the nested guest state */
if (svm->nested.vmcb12_gpa != svm->nested.last_vmcb12_gpa) {
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 5.15.y] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN
2025-12-29 14:36 FAILED: patch "[PATCH] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN" failed to apply to 5.15-stable tree gregkh
@ 2025-12-31 14:39 ` Sasha Levin
2026-01-05 20:27 ` Sean Christopherson
0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2025-12-31 14:39 UTC (permalink / raw)
To: stable; +Cc: Jim Mattson, Sean Christopherson, Sasha Levin
From: Jim Mattson <jmattson@google.com>
[ Upstream commit 7c8b465a1c91f674655ea9cec5083744ec5f796a ]
Mark the VMCB_NPT bit as dirty in nested_vmcb02_prepare_save()
on every nested VMRUN.
If L1 changes the PAT MSR between two VMRUN instructions on the same
L1 vCPU, the g_pat field in the associated vmcb02 will change, and the
VMCB_NPT clean bit should be cleared.
Fixes: 4bb170a5430b ("KVM: nSVM: do not mark all VMCB02 fields dirty on nested vmexit")
Cc: stable@vger.kernel.org
Signed-off-by: Jim Mattson <jmattson@google.com>
Link: https://lore.kernel.org/r/20250922162935.621409-3-jmattson@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
[ adapted vmcb02 local variable to svm->vmcb direct access pattern ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/svm/nested.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index c24d7860bd53..5f9f14eb61c4 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -456,6 +456,7 @@ static void nested_vmcb02_prepare_save(struct vcpu_svm *svm, struct vmcb *vmcb12
bool new_vmcb12 = false;
nested_vmcb02_compute_g_pat(svm);
+ vmcb_mark_dirty(svm->vmcb, VMCB_NPT);
/* Load the nested guest state */
if (svm->nested.vmcb12_gpa != svm->nested.last_vmcb12_gpa) {
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 5.15.y] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN
2025-12-31 14:39 ` [PATCH 5.15.y] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN Sasha Levin
@ 2026-01-05 20:27 ` Sean Christopherson
0 siblings, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2026-01-05 20:27 UTC (permalink / raw)
To: Sasha Levin; +Cc: stable, Jim Mattson
On Wed, Dec 31, 2025, Sasha Levin wrote:
> From: Jim Mattson <jmattson@google.com>
>
> [ Upstream commit 7c8b465a1c91f674655ea9cec5083744ec5f796a ]
>
> Mark the VMCB_NPT bit as dirty in nested_vmcb02_prepare_save()
> on every nested VMRUN.
>
> If L1 changes the PAT MSR between two VMRUN instructions on the same
> L1 vCPU, the g_pat field in the associated vmcb02 will change, and the
> VMCB_NPT clean bit should be cleared.
>
> Fixes: 4bb170a5430b ("KVM: nSVM: do not mark all VMCB02 fields dirty on nested vmexit")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jim Mattson <jmattson@google.com>
> Link: https://lore.kernel.org/r/20250922162935.621409-3-jmattson@google.com
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> [ adapted vmcb02 local variable to svm->vmcb direct access pattern ]
FWIW, I double checked that vmcb02 is indeed guaranteed to be the active vmcb.
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
Acked-by: Sean Christopherson <seanjc@google.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-01-05 20:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-29 14:36 FAILED: patch "[PATCH] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN" failed to apply to 5.15-stable tree gregkh
2025-12-31 14:39 ` [PATCH 5.15.y] KVM: SVM: Mark VMCB_NPT as dirty on nested VMRUN Sasha Levin
2026-01-05 20:27 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).