]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge tag 'vfio-v4.1-rc1' of git://github.com/awilliam/linux-vfio
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 01:06:47 +0000 (18:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 15 Apr 2015 01:06:47 +0000 (18:06 -0700)
Pull VFIO updates from Alex Williamson:

 - VFIO platform bus driver support (Baptiste Reynal, Antonios Motakis,
   testing and review by Eric Auger)

 - Split VFIO irqfd support to separate module (Alex Williamson)

 - vfio-pci VGA arbiter client (Alex Williamson)

 - New vfio-pci.ids= module option (Alex Williamson)

 - vfio-pci D3 power state support for idle devices (Alex Williamson)

* tag 'vfio-v4.1-rc1' of git://github.com/awilliam/linux-vfio: (30 commits)
  vfio-pci: Fix use after free
  vfio-pci: Move idle devices to D3hot power state
  vfio-pci: Remove warning if try-reset fails
  vfio-pci: Allow PCI IDs to be specified as module options
  vfio-pci: Add VGA arbiter client
  vfio-pci: Add module option to disable VGA region access
  vgaarb: Stub vga_set_legacy_decoding()
  vfio: Split virqfd into a separate module for vfio bus drivers
  vfio: virqfd_lock can be static
  vfio: put off the allocation of "minor" in vfio_create_group
  vfio/platform: implement IRQ masking/unmasking via an eventfd
  vfio: initialize the virqfd workqueue in VFIO generic code
  vfio: move eventfd support code for VFIO_PCI to a separate file
  vfio: pass an opaque pointer on virqfd initialization
  vfio: add local lock for virqfd instead of depending on VFIO PCI
  vfio: virqfd: rename vfio_pci_virqfd_init and vfio_pci_virqfd_exit
  vfio: add a vfio_ prefix to virqfd_enable and virqfd_disable and export
  vfio/platform: support for level sensitive interrupts
  vfio/platform: trigger an interrupt via eventfd
  vfio/platform: initial interrupts support code
  ...

1  2 
include/linux/vfio.h

diff --combined include/linux/vfio.h
index 049b2f497bc79cac035faac38e4b808d9daf9af4,cbed15f194e013a275d087235d88932d93376bcb..ddb44097538245f17e882efff635143ada49e089
@@@ -14,6 -14,8 +14,8 @@@
  
  #include <linux/iommu.h>
  #include <linux/mm.h>
+ #include <linux/workqueue.h>
+ #include <linux/poll.h>
  #include <uapi/linux/vfio.h>
  
  /**
@@@ -78,6 -80,19 +80,6 @@@ extern int vfio_register_iommu_driver(c
  extern void vfio_unregister_iommu_driver(
                                const struct vfio_iommu_driver_ops *ops);
  
 -/**
 - * offsetofend(TYPE, MEMBER)
 - *
 - * @TYPE: The type of the structure
 - * @MEMBER: The member within the structure to get the end offset of
 - *
 - * Simple helper macro for dealing with variable sized structures passed
 - * from user space.  This allows us to easily determine if the provided
 - * structure is sized to include various fields.
 - */
 -#define offsetofend(TYPE, MEMBER) \
 -      (offsetof(TYPE, MEMBER) + sizeof(((TYPE *)0)->MEMBER))
 -
  /*
   * External user API
   */
@@@ -110,4 -125,27 +112,27 @@@ static inline long vfio_spapr_iommu_eeh
        return -ENOTTY;
  }
  #endif /* CONFIG_EEH */
+ /*
+  * IRQfd - generic
+  */
+ struct virqfd {
+       void                    *opaque;
+       struct eventfd_ctx      *eventfd;
+       int                     (*handler)(void *, void *);
+       void                    (*thread)(void *, void *);
+       void                    *data;
+       struct work_struct      inject;
+       wait_queue_t            wait;
+       poll_table              pt;
+       struct work_struct      shutdown;
+       struct virqfd           **pvirqfd;
+ };
+ extern int vfio_virqfd_enable(void *opaque,
+                             int (*handler)(void *, void *),
+                             void (*thread)(void *, void *),
+                             void *data, struct virqfd **pvirqfd, int fd);
+ extern void vfio_virqfd_disable(struct virqfd **pvirqfd);
  #endif /* VFIO_H */