]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: fix SMP
authorSasha Levin <levinsasha928@gmail.com>
Mon, 17 Sep 2012 08:03:35 +0000 (10:03 +0200)
committerPekka Enberg <penberg@kernel.org>
Tue, 18 Sep 2012 07:33:17 +0000 (10:33 +0300)
We accidently broke SMP when we moved mptable init to before we initialize the vcpu
count, that means that we always built smptable which was not properly initialized
for the given configuration.

Instead of initializing mptable as part of the kvm arch initialization, let it
be initialized on it's own in the firmware initialization level.

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

index e636d434b8fc4e5a52aa9d7baa7c2f6adadc4f5b..ecada450c26ed7170a81e3aa9f8faefe07288ac2 100644 (file)
@@ -342,27 +342,17 @@ bool load_bzimage(struct kvm *kvm, int fd_kernel,
  */
 int kvm__arch_setup_firmware(struct kvm *kvm)
 {
-       int r;
-
        /* standart minimal configuration */
        setup_bios(kvm);
 
        /* FIXME: SMP, ACPI and friends here */
 
-       /* MP table */
-       r = mptable__init(kvm);
-
-       return r;
+       return 0;
 }
 
 int kvm__arch_free_firmware(struct kvm *kvm)
 {
-       int r;
-
-       /* MP table */
-       r = mptable__exit(kvm);
-
-       return r;
+       return 0;
 }
 
 void kvm__arch_periodic_poll(struct kvm *kvm)
index 12bdcf8f32b8da5a7be6fa2cbe885be5711ffd0d..ea8c6e8c848f242b262e55c4c2efa67013bb099c 100644 (file)
@@ -280,8 +280,10 @@ int mptable__init(struct kvm *kvm)
 
        return 0;
 }
+firmware_init(mptable__init);
 
 int mptable__exit(struct kvm *kvm)
 {
        return 0;
 }
+firmware_exit(mptable__exit);