Skip to content

Commit 36f36a6

Browse files
sean-jcgregkh
authored andcommitted
KVM: SVM: Explicitly mark vmcb01 dirty after modifying VMCB intercepts
commit d5bde61 upstream. When reacting to an intercept update, explicitly mark vmcb01's intercepts dirty, as KVM always initially operates on vmcb01, and nested_svm_vmexit() isn't guaranteed to mark VMCB_INTERCEPTS as dirty. I.e. if L2 is active, KVM will modify the intercepts for L1, but might not mark them as dirty before the next VMRUN of L1. Fixes: 116a0a2 ("KVM: SVM: Add clean-bit for intercetps, tsc-offset and pause filter count") Cc: stable@vger.kernel.org Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev> Link: https://patch.msgid.link/20260218230958.2877682-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3ac9d42 commit 36f36a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

arch/x86/kvm/svm/nested.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ void recalc_intercepts(struct vcpu_svm *svm)
129129
struct vmcb_ctrl_area_cached *g;
130130
unsigned int i;
131131

132-
vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS);
132+
vmcb_mark_dirty(svm->vmcb01.ptr, VMCB_INTERCEPTS);
133133

134134
if (!is_guest_mode(&svm->vcpu))
135135
return;
136136

137+
vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS);
138+
137139
c = &svm->vmcb->control;
138140
h = &svm->vmcb01.ptr->control;
139141
g = &svm->nested.ctl;

0 commit comments

Comments
 (0)