]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nSVM: Pull CS.Base from actual VMCB12 for soft int/ex re-injection
authorMaciej S. Szmigiero <maciej.szmigiero@oracle.com>
Mon, 18 Jul 2022 15:47:13 +0000 (17:47 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Jul 2022 17:22:14 +0000 (13:22 -0400)
commitb733760b5669745360313b24b2a5af760a58cf97
treeea5a9c2faa1779bc4f65f4fd549f08f50f408bfd
parent2c74461ee878830de8d20b46b4f4586a5994179f
KVM: nSVM: Pull CS.Base from actual VMCB12 for soft int/ex re-injection

enter_svm_guest_mode() first calls nested_vmcb02_prepare_control() to copy
control fields from VMCB12 to the current VMCB, then
nested_vmcb02_prepare_save() to perform a similar copy of the save area.

This means that nested_vmcb02_prepare_control() still runs with the
previous save area values in the current VMCB so it shouldn't take the L2
guest CS.Base from this area.

Explicitly pull CS.Base from the actual VMCB12 instead in
enter_svm_guest_mode().

Granted, having a non-zero CS.Base is a very rare thing (and even
impossible in 64-bit mode), having it change between nested VMRUNs is
probably even rarer, but if it happens it would create a really subtle bug
so it's better to fix it upfront.

Fixes: 6dc162c00eef ("KVM: SVM: Re-inject INT3/INTO instead of retrying the instruction")
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <4caa0f67589ae3c22c311ee0e6139496902f2edc.1658159083.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c