summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/arch_timer.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2025-06-25 17:12:25 -0700
committerSean Christopherson <seanjc@google.com>2025-07-09 09:33:42 -0700
commit95826e1ed3592cb81262c7e533ddea60751095c9 (patch)
tree8c15ec661e4c7715f2c9cf9d8830def986b5fd82 /tools/testing/selftests/kvm/arch_timer.c
parentdf98ce784aebdf4b1448ec2abfbbcd8f48b2e295 (diff)
downloadlinux-next-95826e1ed3592cb81262c7e533ddea60751095c9.tar.gz
linux-next-95826e1ed3592cb81262c7e533ddea60751095c9.zip
KVM: selftests: Convert arch_timer tests to common helpers to pin task
Convert the arch timer tests to use __pin_task_to_cpu() and pin_self_to_cpu(). No functional change intended. Link: https://lore.kernel.org/r/20250626001225.744268-6-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/arch_timer.c')
-rw-r--r--tools/testing/selftests/kvm/arch_timer.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/testing/selftests/kvm/arch_timer.c b/tools/testing/selftests/kvm/arch_timer.c
index acb2cb596332..cf8fb67104f1 100644
--- a/tools/testing/selftests/kvm/arch_timer.c
+++ b/tools/testing/selftests/kvm/arch_timer.c
@@ -98,16 +98,11 @@ static uint32_t test_get_pcpu(void)
static int test_migrate_vcpu(unsigned int vcpu_idx)
{
int ret;
- cpu_set_t cpuset;
uint32_t new_pcpu = test_get_pcpu();
- CPU_ZERO(&cpuset);
- CPU_SET(new_pcpu, &cpuset);
-
pr_debug("Migrating vCPU: %u to pCPU: %u\n", vcpu_idx, new_pcpu);
- ret = pthread_setaffinity_np(pt_vcpu_run[vcpu_idx],
- sizeof(cpuset), &cpuset);
+ ret = __pin_task_to_cpu(pt_vcpu_run[vcpu_idx], new_pcpu);
/* Allow the error where the vCPU thread is already finished */
TEST_ASSERT(ret == 0 || ret == ESRCH,