Skip to content

Commit 221d654

Browse files
huthsean-jc
authored andcommitted
KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it
The regs structure just accidentally contains the right values from the previous test in the spot where we want to change rbx. It's cleaner if we properly initialize the structure here before using it. Suggested-by: Sean Christopherson <[email protected]> Signed-off-by: Thomas Huth <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent e100862 commit 221d654

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/kvm/x86_64/sync_regs_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ int main(int argc, char *argv[])
315315
run->kvm_valid_regs = 0;
316316
run->kvm_dirty_regs = 0;
317317
run->s.regs.regs.rbx = 0xAAAA;
318+
vcpu_regs_get(vcpu, &regs);
318319
regs.rbx = 0xBAC0;
319320
vcpu_regs_set(vcpu, &regs);
320321
vcpu_run(vcpu);

0 commit comments

Comments
 (0)