Commit 221d6544 authored by Thomas Huth's avatar Thomas Huth Committed by Sean Christopherson

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: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20240208204844.119326-3-thuth@redhat.comSigned-off-by: default avatarSean Christopherson <seanjc@google.com>
parent e1008628
...@@ -315,6 +315,7 @@ int main(int argc, char *argv[]) ...@@ -315,6 +315,7 @@ int main(int argc, char *argv[])
run->kvm_valid_regs = 0; run->kvm_valid_regs = 0;
run->kvm_dirty_regs = 0; run->kvm_dirty_regs = 0;
run->s.regs.regs.rbx = 0xAAAA; run->s.regs.regs.rbx = 0xAAAA;
vcpu_regs_get(vcpu, &regs);
regs.rbx = 0xBAC0; regs.rbx = 0xBAC0;
vcpu_regs_set(vcpu, &regs); vcpu_regs_set(vcpu, &regs);
vcpu_run(vcpu); vcpu_run(vcpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment