From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: [PATCH kvm-unit-tests 5/6] arm/arm64: spinlock-test: apply smp_run Date: Thu, 25 May 2017 12:28:48 +0200 Message-ID: <20170525102849.22754-6-drjones@redhat.com> References: <20170525102849.22754-1-drjones@redhat.com> Cc: pbonzini@redhat.com, rkrcmar@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57084 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033802AbdEYK3R (ORCPT ); Thu, 25 May 2017 06:29:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F3B5810450 for ; Thu, 25 May 2017 10:29:16 +0000 (UTC) In-Reply-To: <20170525102849.22754-1-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Andrew Jones --- arm/spinlock-test.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arm/spinlock-test.c b/arm/spinlock-test.c index b2fdbab03f83..d1e45d2d9b05 100644 --- a/arm/spinlock-test.c +++ b/arm/spinlock-test.c @@ -12,7 +12,6 @@ #include #include -#include #include #define LOOP_SIZE 10000000 @@ -44,8 +43,6 @@ static void none_unlock(int *lock_var) static int global_a, global_b; static int global_lock; -static cpumask_t smp_test_complete; - static void test_spinlock(void) { int i, errors = 0; @@ -71,16 +68,10 @@ static void test_spinlock(void) lock_ops.unlock(&global_lock); } report("CPU%d: Done - Errors: %d", errors == 0, cpu, errors); - - cpumask_set_cpu(cpu, &smp_test_complete); - if (cpu != 0) - halt(); } int main(int argc, char **argv) { - int cpu; - if (argc > 1 && strcmp(argv[1], "bad") != 0) { lock_ops.lock = gcc_builtin_lock; lock_ops.unlock = gcc_builtin_unlock; @@ -89,16 +80,7 @@ int main(int argc, char **argv) lock_ops.unlock = none_unlock; } - for_each_present_cpu(cpu) { - if (cpu == 0) - continue; - smp_boot_secondary(cpu, test_spinlock); - } - - test_spinlock(); - - while (!cpumask_full(&smp_test_complete)) - cpu_relax(); + smp_run(test_spinlock); return report_summary(); } -- 2.9.4