@@ -83,20 +83,18 @@ static void steal_time_init(struct kvm_vcpu *vcpu, uint32_t i)
83
83
static void steal_time_dump (struct kvm_vm * vm , uint32_t vcpu_idx )
84
84
{
85
85
struct kvm_steal_time * st = addr_gva2hva (vm , (ulong )st_gva [vcpu_idx ]);
86
- int i ;
87
86
88
- pr_info ("VCPU%d:\n" , vcpu_idx );
89
- pr_info (" steal: %lld\n" , st -> steal );
90
- pr_info (" version: %d\n" , st -> version );
91
- pr_info (" flags: %d\n" , st -> flags );
92
- pr_info (" preempted: %d\n" , st -> preempted );
93
- pr_info (" u8_pad: " );
94
- for (i = 0 ; i < 3 ; ++ i )
95
- pr_info ("%d" , st -> u8_pad [i ]);
96
- pr_info ("\n pad: " );
97
- for (i = 0 ; i < 11 ; ++ i )
98
- pr_info ("%d" , st -> pad [i ]);
99
- pr_info ("\n" );
87
+ ksft_print_msg ("VCPU%d:\n" , vcpu_idx );
88
+ ksft_print_msg (" steal: %lld\n" , st -> steal );
89
+ ksft_print_msg (" version: %d\n" , st -> version );
90
+ ksft_print_msg (" flags: %d\n" , st -> flags );
91
+ ksft_print_msg (" preempted: %d\n" , st -> preempted );
92
+ ksft_print_msg (" u8_pad: %d %d %d\n" ,
93
+ st -> u8_pad [0 ], st -> u8_pad [1 ], st -> u8_pad [2 ]);
94
+ ksft_print_msg (" pad: %d %d %d %d %d %d %d %d %d %d %d\n" ,
95
+ st -> pad [0 ], st -> pad [1 ], st -> pad [2 ], st -> pad [3 ],
96
+ st -> pad [4 ], st -> pad [5 ], st -> pad [6 ], st -> pad [7 ],
97
+ st -> pad [8 ], st -> pad [9 ], st -> pad [10 ]);
100
98
}
101
99
102
100
#elif defined(__aarch64__ )
@@ -199,10 +197,10 @@ static void steal_time_dump(struct kvm_vm *vm, uint32_t vcpu_idx)
199
197
{
200
198
struct st_time * st = addr_gva2hva (vm , (ulong )st_gva [vcpu_idx ]);
201
199
202
- pr_info ("VCPU%d:\n" , vcpu_idx );
203
- pr_info (" rev: %d\n" , st -> rev );
204
- pr_info (" attr: %d\n" , st -> attr );
205
- pr_info (" st_time: %ld\n" , st -> st_time );
200
+ ksft_print_msg ("VCPU%d:\n" , vcpu_idx );
201
+ ksft_print_msg (" rev: %d\n" , st -> rev );
202
+ ksft_print_msg (" attr: %d\n" , st -> attr );
203
+ ksft_print_msg (" st_time: %ld\n" , st -> st_time );
206
204
}
207
205
208
206
#elif defined(__riscv )
@@ -366,7 +364,9 @@ int main(int ac, char **av)
366
364
vm_userspace_mem_region_add (vm , VM_MEM_SRC_ANONYMOUS , ST_GPA_BASE , 1 , gpages , 0 );
367
365
virt_map (vm , ST_GPA_BASE , ST_GPA_BASE , gpages );
368
366
367
+ ksft_print_header ();
369
368
TEST_REQUIRE (is_steal_time_supported (vcpus [0 ]));
369
+ ksft_set_plan (NR_VCPUS );
370
370
371
371
/* Run test on each VCPU */
372
372
for (i = 0 ; i < NR_VCPUS ; ++ i ) {
@@ -407,14 +407,15 @@ int main(int ac, char **av)
407
407
run_delay , stolen_time );
408
408
409
409
if (verbose ) {
410
- pr_info ("VCPU%d: total-stolen-time=%ld test-stolen-time=%ld" , i ,
411
- guest_stolen_time [i ], stolen_time );
412
- if (stolen_time == run_delay )
413
- pr_info (" (BONUS: guest test-stolen-time even exactly matches test-run_delay)" );
414
- pr_info ("\n" );
410
+ ksft_print_msg ("VCPU%d: total-stolen-time=%ld test-stolen-time=%ld%s\n" ,
411
+ i , guest_stolen_time [i ], stolen_time ,
412
+ stolen_time == run_delay ?
413
+ " (BONUS: guest test-stolen-time even exactly matches test-run_delay)" : "" );
415
414
steal_time_dump (vm , i );
416
415
}
416
+ ksft_test_result_pass ("vcpu%d\n" , i );
417
417
}
418
418
419
- return 0 ;
419
+ /* Print results and exit() accordingly */
420
+ ksft_finished ();
420
421
}
0 commit comments