Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: breakpoints: fix computation of test plan

The computation of the test plan uses the available_cpus bitset
before calling sched_getaffinity to fill it in. The resulting
plan is bogus, fix it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Paolo Bonzini and committed by
Shuah Khan
ce32659b b85d387c

+4 -4
+4 -4
tools/testing/selftests/breakpoints/step_after_suspend_test.c
··· 183 183 } 184 184 } 185 185 186 + err = sched_getaffinity(0, sizeof(available_cpus), &available_cpus); 187 + if (err < 0) 188 + ksft_exit_fail_msg("sched_getaffinity() failed\n"); 189 + 186 190 for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { 187 191 if (!CPU_ISSET(cpu, &available_cpus)) 188 192 continue; ··· 196 192 197 193 if (do_suspend) 198 194 suspend(); 199 - 200 - err = sched_getaffinity(0, sizeof(available_cpus), &available_cpus); 201 - if (err < 0) 202 - ksft_exit_fail_msg("sched_getaffinity() failed\n"); 203 195 204 196 for (cpu = 0; cpu < CPU_SETSIZE; cpu++) { 205 197 bool test_success;