Skip to content

Commit 29b76a9

Browse files
mdouchapevik
authored andcommitted
kvm_svm02: Fix saved stack segment index value
The VMCB init helper function expects GDT item index while the VMCB segment selector values are byte offsets. Shift the byte offset of saved stack segment selector to get the correct GDT index. Link: https://lore.kernel.org/ltp/[email protected]/ Acked-by: Petr Vorel <[email protected]> Signed-off-by: Martin Doucha <[email protected]>
1 parent 90f8032 commit 29b76a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testcases/kernel/kvm/kvm_svm02.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void main(void)
9696
vmsave_buf = kvm_alloc_vmcb();
9797

9898
/* Save allocated stack for later VM reinit */
99-
ss = vcpu->vmcb->ss.selector;
99+
ss = vcpu->vmcb->ss.selector >> 3;
100100
rsp = vcpu->vmcb->rsp;
101101

102102
/* Load partial state from vmsave_buf and save it to vcpu->vmcb */

0 commit comments

Comments
 (0)