]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge tag 'kvm-3.10-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 May 2013 16:08:21 +0000 (09:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 May 2013 16:08:21 +0000 (09:08 -0700)
Pull kvm fixes from Gleb Natapov:
 "Most of the fixes are in the emulator since now we emulate more than
  we did before for correctness sake we see more bugs there, but there
  is also an OOPS fixed and corruption of xcr0 register."

* tag 'kvm-3.10-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: emulator: emulate SALC
  KVM: emulator: emulate XLAT
  KVM: emulator: emulate AAM
  KVM: VMX: fix halt emulation while emulating invalid guest sate
  KVM: Fix kvm_irqfd_init initialization
  KVM: x86: fix maintenance of guest/host xcr0 state

1  2 
virt/kvm/kvm_main.c

diff --combined virt/kvm/kvm_main.c
index ae88b719bd2e477bbdb729f0b55555ebc869fcef,8a1889ccb8830174339debe1e16cd353141af225..302681c4aa4465bb21b69524d7c0d3a5341f4a4e
@@@ -1978,7 -1978,7 +1978,7 @@@ static long kvm_vcpu_ioctl(struct file 
        if (vcpu->kvm->mm != current->mm)
                return -EIO;
  
 -#if defined(CONFIG_S390) || defined(CONFIG_PPC)
 +#if defined(CONFIG_S390) || defined(CONFIG_PPC) || defined(CONFIG_MIPS)
        /*
         * Special cases: vcpu ioctls that are asynchronous to vcpu execution,
         * so vcpu_load() would break it.
@@@ -3105,13 -3105,21 +3105,21 @@@ int kvm_init(void *opaque, unsigned vcp
        int r;
        int cpu;
  
-       r = kvm_irqfd_init();
-       if (r)
-               goto out_irqfd;
        r = kvm_arch_init(opaque);
        if (r)
                goto out_fail;
  
+       /*
+        * kvm_arch_init makes sure there's at most one caller
+        * for architectures that support multiple implementations,
+        * like intel and amd on x86.
+        * kvm_arch_init must be called before kvm_irqfd_init to avoid creating
+        * conflicts in case kvm is already setup for another implementation.
+        */
+       r = kvm_irqfd_init();
+       if (r)
+               goto out_irqfd;
        if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
                r = -ENOMEM;
                goto out_free_0;
@@@ -3186,10 -3194,10 +3194,10 @@@ out_free_1
  out_free_0a:
        free_cpumask_var(cpus_hardware_enabled);
  out_free_0:
-       kvm_arch_exit();
- out_fail:
        kvm_irqfd_exit();
  out_irqfd:
+       kvm_arch_exit();
+ out_fail:
        return r;
  }
  EXPORT_SYMBOL_GPL(kvm_init);