public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, rkrcmar@redhat.com
Subject: [PATCH kvm-unit-tests 5/6] arm/arm64: spinlock-test: apply smp_run
Date: Thu, 25 May 2017 12:28:48 +0200	[thread overview]
Message-ID: <20170525102849.22754-6-drjones@redhat.com> (raw)
In-Reply-To: <20170525102849.22754-1-drjones@redhat.com>

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 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

  parent reply	other threads:[~2017-05-25 10:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 10:28 [PATCH kvm-unit-tests 0/6] arm/arm64: some cleanups Andrew Jones
2017-05-25 10:28 ` [PATCH kvm-unit-tests 1/6] lib/arm/gic: gic_version cleanup Andrew Jones
2017-05-25 13:53   ` Paolo Bonzini
2017-05-25 14:28     ` Andrew Jones
2017-05-25 10:28 ` [PATCH kvm-unit-tests 2/6] lib/arm/psci: make psci less ugly Andrew Jones
2017-05-25 10:28 ` [PATCH kvm-unit-tests 3/6] lib/arm/smp: introduce smp_run Andrew Jones
2017-05-25 13:56   ` Paolo Bonzini
2017-05-25 14:41     ` Andrew Jones
2017-05-25 15:07       ` Paolo Bonzini
2017-05-26 11:47         ` Andrew Jones
2017-05-26 12:11           ` Paolo Bonzini
2017-05-25 10:28 ` [PATCH kvm-unit-tests 4/6] arm/arm64: selftest: apply smp_run Andrew Jones
2017-05-25 10:28 ` Andrew Jones [this message]
2017-05-25 10:28 ` [PATCH kvm-unit-tests 6/6] arm/arm64: gic: " Andrew Jones
2017-05-25 13:56 ` [PATCH kvm-unit-tests 0/6] arm/arm64: some cleanups Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170525102849.22754-6-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox