[COMMIT master] kvmclock_test: fix smp initialization

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

 



From: Avi Kivity <avi@xxxxxxxxxx>

cpu_count() is not valid before smp_init().

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>

diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c
index 5b14ae2..52a43fb 100644
--- a/x86/kvmclock_test.c
+++ b/x86/kvmclock_test.c
@@ -115,7 +115,7 @@ static int cycle_test(int ncpus, long loops, int check, struct test_info *ti)
 
 int main(int ac, char **av)
 {
-        int ncpus = cpu_count();
+        int ncpus;
         int nerr = 0, i;
         long loops = DEFAULT_TEST_LOOPS;
         long sec = 0;
@@ -130,6 +130,7 @@ int main(int ac, char **av)
 
         smp_init();
 
+        ncpus = cpu_count();
         if (ncpus > MAX_CPU)
                 ncpus = MAX_CPU;
         for (i = 0; i < ncpus; ++i)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Walks]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux