Skip to content

Commit e100862

Browse files
huthsean-jc
authored andcommitted
KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate
In the spots where we are expecting a successful run, we should use vcpu_run() instead of _vcpu_run() to make sure that the run did not fail. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/20240208204844.119326-2-thuth@redhat.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent db7d6fb commit e100862

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int main(int argc, char *argv[])
259259
/* Request and verify all valid register sets. */
260260
/* TODO: BUILD TIME CHECK: TEST_ASSERT(KVM_SYNC_X86_NUM_FIELDS != 3); */
261261
run->kvm_valid_regs = TEST_SYNC_FIELDS;
262-
rv = _vcpu_run(vcpu);
262+
vcpu_run(vcpu);
263263
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
264264

265265
vcpu_regs_get(vcpu, &regs);
@@ -278,7 +278,7 @@ int main(int argc, char *argv[])
278278

279279
run->kvm_valid_regs = TEST_SYNC_FIELDS;
280280
run->kvm_dirty_regs = KVM_SYNC_X86_REGS | KVM_SYNC_X86_SREGS;
281-
rv = _vcpu_run(vcpu);
281+
vcpu_run(vcpu);
282282
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
283283
TEST_ASSERT(run->s.regs.regs.rbx == 0xBAD1DEA + 1,
284284
"rbx sync regs value incorrect 0x%llx.",
@@ -302,7 +302,7 @@ int main(int argc, char *argv[])
302302
run->kvm_valid_regs = TEST_SYNC_FIELDS;
303303
run->kvm_dirty_regs = 0;
304304
run->s.regs.regs.rbx = 0xDEADBEEF;
305-
rv = _vcpu_run(vcpu);
305+
vcpu_run(vcpu);
306306
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
307307
TEST_ASSERT(run->s.regs.regs.rbx != 0xDEADBEEF,
308308
"rbx sync regs value incorrect 0x%llx.",
@@ -317,7 +317,7 @@ int main(int argc, char *argv[])
317317
run->s.regs.regs.rbx = 0xAAAA;
318318
regs.rbx = 0xBAC0;
319319
vcpu_regs_set(vcpu, &regs);
320-
rv = _vcpu_run(vcpu);
320+
vcpu_run(vcpu);
321321
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
322322
TEST_ASSERT(run->s.regs.regs.rbx == 0xAAAA,
323323
"rbx sync regs value incorrect 0x%llx.",
@@ -334,7 +334,7 @@ int main(int argc, char *argv[])
334334
run->kvm_valid_regs = 0;
335335
run->kvm_dirty_regs = TEST_SYNC_FIELDS;
336336
run->s.regs.regs.rbx = 0xBBBB;
337-
rv = _vcpu_run(vcpu);
337+
vcpu_run(vcpu);
338338
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
339339
TEST_ASSERT(run->s.regs.regs.rbx == 0xBBBB,
340340
"rbx sync regs value incorrect 0x%llx.",

0 commit comments

Comments
 (0)