1. 25 4月, 2013 2 次提交
  2. 28 2月, 2013 1 次提交
  3. 25 2月, 2013 1 次提交
  4. 19 2月, 2013 2 次提交
    • A
      vfio-pci: Add support for VGA region access · 84237a82
      Alex Williamson 提交于
      PCI defines display class VGA regions at I/O port address 0x3b0, 0x3c0
      and MMIO address 0xa0000.  As these are non-overlapping, we can ignore
      the I/O port vs MMIO difference and expose them both in a single
      region.  We make use of the VGA arbiter around each access to
      configure chipset access as necessary.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      84237a82
    • A
      vfio-pci: Manage user power state transitions · 2dd11948
      Alex Williamson 提交于
      We give the user access to change the power state of the device but
      certain transitions result in an uninitialized state which the user
      cannot resolve.  To fix this we need to mark the PowerState field of
      the PMCSR register read-only and effect the requested change on behalf
      of the user.  This has the added benefit that pdev->current_state
      remains accurate while controlled by the user.
      
      The primary example of this bug is a QEMU guest doing a reboot where
      the device it put into D3 on shutdown and becomes unusable on the next
      boot because the device did a soft reset on D3->D0 (NoSoftRst-).
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      2dd11948
  5. 15 2月, 2013 5 次提交
  6. 16 1月, 2013 1 次提交
  7. 08 12月, 2012 6 次提交
  8. 10 10月, 2012 3 次提交
    • A
      vfio: Fix PCI INTx disable consistency · 899649b7
      Alex Williamson 提交于
      The virq_disabled flag tracks the userspace view of INTx masking
      across interrupt mode changes, but we're not consistently applying
      this to the interrupt and masking handler notion of the device.
      Currently if the user sets DisINTx while in MSI or MSIX mode, then
      returns to INTx mode (ex. rebooting a qemu guest), the hardware has
      DisINTx+, but the management of INTx thinks it's enabled, making it
      impossible to actually clear DisINTx.  Fix this by updating the
      handler state when INTx is re-enabled.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      899649b7
    • A
      vfio: Move PCI INTx eventfd setting earlier · 9dbdfd23
      Alex Williamson 提交于
      We need to be ready to recieve an interrupt as soon as we call
      request_irq, so our eventfd context setting needs to be moved
      earlier.  Without this, an interrupt from our device or one
      sharing the interrupt line can pass a NULL into eventfd_signal
      and oops.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      9dbdfd23
    • A
      vfio: Fix PCI mmap after b3b9c293 · 34002f54
      Alex Williamson 提交于
      Our mmap path mistakely relied on vma->vm_pgoff to get set in
      remap_pfn_range.  After b3b9c293, that path only applies to
      copy-on-write mappings.  Set it in our own code.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      34002f54
  9. 09 10月, 2012 1 次提交
    • L
      Fix staging driver use of VM_RESERVED · 547b1e81
      Linus Torvalds 提交于
      The VM_RESERVED flag was killed off in commit 314e51b9 ("mm: kill
      vma flag VM_RESERVED and mm->reserved_vm counter"), and replaced by the
      proper semantic flags (eg "don't core-dump" etc).  But there was a new
      use of VM_RESERVED that got missed by the merge.
      
      Fix the remaining use of VM_RESERVED in the vfio_pci driver, replacing
      the VM_RESERVED flag with VM_DONTEXPAND | VM_DONTDUMP.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation,org>
      547b1e81
  10. 27 9月, 2012 2 次提交
  11. 22 9月, 2012 1 次提交
    • A
      vfio: Fix virqfd release race · b68e7fa8
      Alex Williamson 提交于
      vfoi-pci supports a mechanism like KVM's irqfd for unmasking an
      interrupt through an eventfd.  There are two ways to shutdown this
      interface: 1) close the eventfd, 2) ioctl (such as disabling the
      interrupt).  Both of these do the release through a workqueue,
      which can result in a segfault if two jobs get queued for the same
      virqfd.
      
      Fix this by protecting the pointer to these virqfds by a spinlock.
      The vfio pci device will therefore no longer have a reference to it
      once the release job is queued under lock.  On the ioctl side, we
      still flush the workqueue to ensure that any outstanding releases
      are completed.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      b68e7fa8
  12. 22 8月, 2012 4 次提交
  13. 31 7月, 2012 3 次提交
    • A
      vfio: Add PCI device driver · 89e1f7d4
      Alex Williamson 提交于
      Add PCI device support for VFIO.  PCI devices expose regions
      for accessing config space, I/O port space, and MMIO areas
      of the device.  PCI config access is virtualized in the kernel,
      allowing us to ensure the integrity of the system, by preventing
      various accesses while reducing duplicate support across various
      userspace drivers.  I/O port supports read/write access while
      MMIO also supports mmap of sufficiently sized regions.  Support
      for INTx, MSI, and MSI-X interrupts are provided using eventfds to
      userspace.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      89e1f7d4
    • A
      vfio: Type1 IOMMU implementation · 73fa0d10
      Alex Williamson 提交于
      This VFIO IOMMU backend is designed primarily for AMD-Vi and Intel
      VT-d hardware, but is potentially usable by anything supporting
      similar mapping functionality.  We arbitrarily call this a Type1
      backend for lack of a better name.  This backend has no IOVA
      or host memory mapping restrictions for the user and is optimized
      for relatively static mappings.  Mapped areas are pinned into system
      memory.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      73fa0d10
    • A
      vfio: VFIO core · cba3345c
      Alex Williamson 提交于
      VFIO is a secure user level driver for use with both virtual machines
      and user level drivers.  VFIO makes use of IOMMU groups to ensure the
      isolation of devices in use, allowing unprivileged user access.  It's
      intended that VFIO will replace KVM device assignment and UIO drivers
      (in cases where the target platform includes a sufficiently capable
      IOMMU).
      
      New in this version of VFIO is support for IOMMU groups managed
      through the IOMMU core as well as a rework of the API, removing the
      group merge interface.  We now go back to a model more similar to
      original VFIO with UIOMMU support where the file descriptor obtained
      from /dev/vfio/vfio allows access to the IOMMU, but only after a
      group is added, avoiding the previous privilege issues with this type
      of model.  IOMMU support is also now fully modular as IOMMUs have
      vastly different interface requirements on different platforms.  VFIO
      users are able to query and initialize the IOMMU model of their
      choice.
      
      Please see the follow-on Documentation commit for further description
      and usage example.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      cba3345c