Re: [PATCH v3 17/27] KVM: nSVM: Always switch VMCB before leaving guest mode

From: Jim Mattson

Date: Thu Oct 15 2026 - 18:11:36 EST


On Mon, Oct 12, 2026 at 4:36 PM Yosry Ahmed <yosry@xxxxxxxxxx> wrote:
>
> Move svm_switch_vmcb() calls ahead of leave_guest_mode(), as nothing
> between the calls depends on svm->vmcb being set to vmcb01. This makes
> the nested VM-Exit path consistent with the nested VM-Enter path, and
> having the calls to svm_switch_vmcb() and leave_guest_mode() close makes
> it easier to reason about incoming changes that depend on both VMCB and
> guest_mode context.
>
> No functional change intended.
>
> Signed-off-by: Yosry Ahmed <yosry@xxxxxxxxxx>
Reviewed-by: Jim Mattson <jmattson@xxxxxxxxxx>