]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
Merge tag 'vfio-v4.10-rc3' of git://github.com/awilliam/linux-vfio
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jan 2017 19:19:03 +0000 (11:19 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jan 2017 19:19:03 +0000 (11:19 -0800)
Pull VFIO fixes from Alex Williamson:
 - Add mtty sample driver properly into build system (Alex Williamson)
 - Restore type1 mapping performance after mdev (Alex Williamson)
 - Fix mdev device race (Alex Williamson)
 - Cleanups to the mdev ABI used by vendor drivers (Alex Williamson)
 - Build fix for old compilers (Arnd Bergmann)
 - Fix sample driver error path (Dan Carpenter)
 - Handle pci_iomap() error (Arvind Yadav)
 - Fix mdev ioctl return type (Paul Gortmaker)

* tag 'vfio-v4.10-rc3' of git://github.com/awilliam/linux-vfio:
  vfio-mdev: fix non-standard ioctl return val causing i386 build fail
  vfio-pci: Handle error from pci_iomap
  vfio-mdev: fix some error codes in the sample code
  vfio-pci: use 32-bit comparisons for register address for gcc-4.5
  vfio-mdev: Make mdev_device private and abstract interfaces
  vfio-mdev: Make mdev_parent private
  vfio-mdev: de-polute the namespace, rename parent_device & parent_ops
  vfio-mdev: Fix remove race
  vfio/type1: Restore mapping performance with mdev support
  vfio-mdev: Fix mtty sample driver building

1  2 
drivers/gpu/drm/i915/gvt/kvmgt.c

index 934963970288e28db522eecc8ab603d4b34472c0,f8021a01df63da26e399701b49f6ebd4fed26245..faaae07ae487277973533bbf907b6eefc2632a48
@@@ -500,19 -497,10 +500,19 @@@ static int intel_vgpu_open(struct mdev_
                goto undo_iommu;
        }
  
 -      return kvmgt_guest_init(mdev);
 +      ret = kvmgt_guest_init(mdev);
 +      if (ret)
 +              goto undo_group;
 +
 +      atomic_set(&vgpu->vdev.released, 0);
 +      return ret;
 +
 +undo_group:
-       vfio_unregister_notifier(&mdev->dev, VFIO_GROUP_NOTIFY,
++      vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
 +                                      &vgpu->vdev.group_notifier);
  
  undo_iommu:
-       vfio_unregister_notifier(&mdev->dev, VFIO_IOMMU_NOTIFY,
+       vfio_unregister_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
                                        &vgpu->vdev.iommu_notifier);
  out:
        return ret;
@@@ -526,16 -513,10 +526,16 @@@ static void __intel_vgpu_release(struc
        if (!handle_valid(vgpu->handle))
                return;
  
 -      vfio_unregister_notifier(mdev_dev(vgpu->vdev.mdev), VFIO_IOMMU_NOTIFY,
 +      if (atomic_cmpxchg(&vgpu->vdev.released, 0, 1))
 +              return;
 +
-       ret = vfio_unregister_notifier(&vgpu->vdev.mdev->dev, VFIO_IOMMU_NOTIFY,
++      ret = vfio_unregister_notifier(mdev_dev(vgpu->vdev.mdev), VFIO_IOMMU_NOTIFY,
                                        &vgpu->vdev.iommu_notifier);
 -      vfio_unregister_notifier(mdev_dev(vgpu->vdev.mdev), VFIO_GROUP_NOTIFY,
 +      WARN(ret, "vfio_unregister_notifier for iommu failed: %d\n", ret);
 +
-       ret = vfio_unregister_notifier(&vgpu->vdev.mdev->dev, VFIO_GROUP_NOTIFY,
++      ret = vfio_unregister_notifier(mdev_dev(vgpu->vdev.mdev), VFIO_GROUP_NOTIFY,
                                        &vgpu->vdev.group_notifier);
 +      WARN(ret, "vfio_unregister_notifier for group failed: %d\n", ret);
  
        info = (struct kvmgt_guest_info *)vgpu->handle;
        kvmgt_guest_exit(info);