[PATCH kvm-unit-tests 5/6] arm/arm64: spinlock-test: apply smp_run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 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 <libcflat.h>
 #include <asm/smp.h>
-#include <asm/cpumask.h>
 #include <asm/barrier.h>
 
 #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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux