Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Nov 2019 21:19:15 +0000 (13:19 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 12 Nov 2019 21:19:15 +0000 (13:19 -0800)
Pull kvm fixes from Paolo Bonzini:
 "Fix unwinding of KVM_CREATE_VM failure, VT-d posted interrupts,
  DAX/ZONE_DEVICE, and module unload/reload"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  KVM: MMU: Do not treat ZONE_DEVICE pages as being reserved
  KVM: VMX: Introduce pi_is_pir_empty() helper
  KVM: VMX: Do not change PID.NDST when loading a blocked vCPU
  KVM: VMX: Consider PID.PIR to determine if vCPU has pending interrupts
  KVM: VMX: Fix comment to specify PID.ON instead of PIR.ON
  KVM: X86: Fix initialization of MSR lists
  KVM: fix placement of refcount initialization
  KVM: Fix NULL-ptr deref after kvm_create_vm fails

1  2 
arch/x86/kvm/mmu.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c

Simple merge
Simple merge
Simple merge
@@@ -693,17 -700,8 +718,12 @@@ static struct kvm *kvm_create_vm(unsign
        INIT_HLIST_HEAD(&kvm->irq_ack_notifier_list);
  #endif
  
-       if (init_srcu_struct(&kvm->srcu))
-               goto out_err_no_srcu;
-       if (init_srcu_struct(&kvm->irq_srcu))
-               goto out_err_no_irq_srcu;
        r = kvm_init_mmu_notifier(kvm);
        if (r)
 +              goto out_err_no_mmu_notifier;
 +
 +      r = kvm_arch_post_init_vm(kvm);
 +      if (r)
                goto out_err;
  
        mutex_lock(&kvm_lock);
        return kvm;
  
  out_err:
-       cleanup_srcu_struct(&kvm->irq_srcu);
- out_err_no_irq_srcu:
-       cleanup_srcu_struct(&kvm->srcu);
- out_err_no_srcu:
 +#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
 +      if (kvm->mmu_notifier.ops)
 +              mmu_notifier_unregister(&kvm->mmu_notifier, current->mm);
 +#endif
 +out_err_no_mmu_notifier:
        hardware_disable_all();
  out_err_no_disable:
        kvm_arch_destroy_vm(kvm);