smptest was failing and we didn't notice, turn it into unit test.

Signed-off-by: Radim Krčmář <rkrc...@redhat.com>
---
 x86/smptest.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/x86/smptest.c b/x86/smptest.c
index 37805999b3b0..acda22e18314 100644
--- a/x86/smptest.c
+++ b/x86/smptest.c
@@ -1,6 +1,8 @@
 #include "libcflat.h"
 #include "smp.h"
 
+unsigned nipis;
+
 static void ipi_test(void *data)
 {
     int n = (long)data;
@@ -8,6 +10,8 @@ static void ipi_test(void *data)
     printf("ipi called, cpu %d\n", n);
     if (n != smp_id())
        printf("but wrong cpu %d\n", smp_id());
+    else
+        nipis++;
 }
 
 int main()
@@ -21,5 +25,7 @@ int main()
     printf("found %d cpus\n", ncpus);
     for (i = 0; i < ncpus; ++i)
        on_cpu(i, ipi_test, (void *)(long)i);
-    return 0;
+
+    report("IPI to each CPU", nipis == ncpus);
+    return report_summary();
 }
-- 
2.2.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to