]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation
authorYosry Ahmed <yosry.ahmed@linux.dev>
Sat, 10 Jan 2026 00:48:18 +0000 (00:48 +0000)
committerSean Christopherson <seanjc@google.com>
Wed, 14 Jan 2026 21:39:33 +0000 (13:39 -0800)
commit127ccae2c185f62e6ecb4bf24f9cb307e9b9c619
treedbf1e0c46515b52176b3ec3c7c07c41631e93a25
parentf00ccdede3c84df2287e59b546fd92d58b7e07af
KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation

Commit cc3ed80ae69f ("KVM: nSVM: always use vmcb01 to for vmsave/vmload
of guest state") made KVM always use vmcb01 for the fields controlled by
VMSAVE/VMLOAD, but it missed updating the VMLOAD/VMSAVE emulation code
to always use vmcb01.

As a result, if VMSAVE/VMLOAD is executed by an L2 guest and is not
intercepted by L1, KVM will mistakenly use vmcb02. Always use vmcb01
instead of the current VMCB.

Fixes: cc3ed80ae69f ("KVM: nSVM: always use vmcb01 to for vmsave/vmload of guest state")
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20260110004821.3411245-2-yosry.ahmed@linux.dev
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c