Re: [PATCH v6 7/7] KVM: SVM: Add Page modification logging support

Sean Christopherson
2026-04-21T23:15:26Z

On Tue, Apr 21, 2026, Yosry Ahmed wrote:
> > @@ -3253,6 +3278,54 @@ static int bus_lock_exit(struct kvm_vcpu *vcpu)
> > return 0;
> > }
> >
> > +void svm_update_cpu_dirty_logging(struct kvm_vcpu *vcpu)
> > +{
> > + struct vcpu_svm *svm = to_svm(vcpu);
> > +
> > + if (WARN_ON_ONCE(!vcpu->kvm->arch.cpu_dirty_log_size))
> > + return;
> > +
> > + guard(svm_vmcb01)(vcpu);
>
> Why do we need this? Why not update vmcb01 directly below?

Yeah, I don't see the point of patch 6. guard(svm_vmcb01) doesn't exist in the
current code base because it's not needed.

> IIUC VMX needs this because it updates the loaded VMCS, but the VMCB is
> just memory.

Yep. If VMWRITE could target an arbitrary VMCS pointer, VMX wouldn't need the
helper either.