]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Enable SMP support
authorSasha Levin <levinsasha928@gmail.com>
Fri, 6 May 2011 23:51:11 +0000 (02:51 +0300)
committerPekka Enberg <penberg@kernel.org>
Sat, 7 May 2011 08:56:58 +0000 (11:56 +0300)
This patch enables SMP support:

[    0.155072] Brought up 3 CPUs
[    0.155074] Total of 3 processors activated (15158.58 BogoMIPS).

virtio-console was being loaded no matter the cmdline options
and it was causing some hangs (have to look into that).

I'll send this patch to a larger audience once someone
else can confirm it actually works/doesn't work.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/kvm-cpu.c
tools/kvm/kvm-run.c

index e66f03e54edd21b1ab69580a1ac32f325980fc89..d7febb380af99a75943c78ef20e7083f330cb6cd 100644 (file)
@@ -378,6 +378,8 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
                kvm_cpu__run(cpu);
 
                switch (cpu->kvm_run->exit_reason) {
+               case KVM_EXIT_UNKNOWN:
+                       break;
                case KVM_EXIT_DEBUG:
                        kvm_cpu__show_registers(cpu);
                        kvm_cpu__show_code(cpu);
index d5a952fac0331c9b56b97ebd13bc151d09be7d49..2685f040536ce278e88ff853fcd91ace3788c787 100644 (file)
@@ -372,12 +372,6 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
        if (nrcpus < 1 || nrcpus > KVM_NR_CPUS)
                die("Number of CPUs %d is out of [1;%d] range", nrcpus, KVM_NR_CPUS);
 
-       /* FIXME: Remove as only SMP gets fully supported */
-       if (nrcpus > 1) {
-               warning("Limiting CPUs to 1, true SMP is not yet implemented");
-               nrcpus = 1;
-       }
-
        if (ram_size < MIN_RAM_SIZE_MB)
                die("Not enough memory specified: %lluMB (min %lluMB)", ram_size, MIN_RAM_SIZE_MB);
 
@@ -410,7 +404,7 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
        kvm->nrcpus = nrcpus;
 
        memset(real_cmdline, 0, sizeof(real_cmdline));
-       strcpy(real_cmdline, "notsc nolapic noacpi pci=conf1 console=ttyS0 ");
+       strcpy(real_cmdline, "notsc noapic noacpi pci=conf1 console=ttyS0 ");
        if (kernel_cmdline)
                strlcat(real_cmdline, kernel_cmdline, sizeof(real_cmdline));
 
@@ -452,7 +446,8 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
 
        pci__init();
 
-       virtio_console__init(kvm);
+       if (active_console == CONSOLE_VIRTIO)
+               virtio_console__init(kvm);
 
        if (virtio_rng)
                virtio_rng__init(kvm);