1. 03 10月, 2013 2 次提交
    • A
      vfio-pci: Test device reset capabilities · befe5176
      Alex Williamson 提交于
      Not all resets are created equal.  PM reset is not very reliable,
      especially for GPUs, so we might want to opt for a bus reset if a
      standard reset will only do a D3hot->D0 transition.  We can also
      use this to tell if the standard reset will do a bus reset (if
      neither has_pm_reset or has_flr is probed, but the device still
      supports reset).
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      befe5176
    • A
      vfio-pci: Add support for MSI affinity · c7679d45
      Alex Williamson 提交于
      When MSI is accelerated through KVM the vectors are only programmed
      when the guest first enables MSI support.  Subsequent writes to the
      vector address or data fields are ignored.  Unfortunately that means
      we're ignore updates done to adjust SMP affinity of the vectors.
      MSI SMP affinity already works in non-KVM mode because the address
      and data fields are read from their backing store on each interrupt.
      
      This patch stores the MSIMessage programmed into KVM so that we can
      determine when changes are made and update the routes.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      c7679d45
  2. 23 8月, 2013 1 次提交
  3. 10 8月, 2013 1 次提交
  4. 29 7月, 2013 1 次提交
  5. 16 7月, 2013 2 次提交
    • V
      vfio: QEMU-AER: Qemu changes to support AER for VFIO-PCI devices · 7b4b0e9e
      Vijay Mohan Pandarathil 提交于
      Add support for error containment when a VFIO device assigned to a KVM
      guest encounters an error. This is for PCIe devices/drivers that support AER
      functionality. When the host OS is notified of an error in a device either
      through the firmware first approach or through an interrupt handled by the AER
      root port driver, the error handler registered by the vfio-pci driver gets
      invoked. The qemu process is signaled through an eventfd registered per
      VFIO device by the qemu process. In the eventfd handler, qemu decides on
      what action to take. In this implementation, guest is brought down to
      contain the error.
      
      The kernel patches for the above functionality has been already accepted.
      
      This is a refresh of the QEMU patch which was reviewed earlier.
      http://marc.info/?l=linux-kernel&m=136281557608087&w=2
      This patch has the same contents and has been built after refreshing
      to latest upstream and after the linux headers have been updated in qemu.
      
      	- Create eventfd per vfio device assigned to a guest and register an
                event handler
      
      	- This fd is passed to the vfio_pci driver through the SET_IRQ ioctl
      
      	- When the device encounters an error, the eventfd is signalled
                and the qemu eventfd handler gets invoked.
      
      	- In the handler decide what action to take. Current action taken
                is to stop the guest.
      Signed-off-by: NVijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      7b4b0e9e
    • A
      vfio-pci: VGA quirk update · 39360f0b
      Alex Williamson 提交于
      Turns out all the suspicions for AMD devices were correct, everywhere
      we read a BAR address that the address matches the config space offset,
      there's full access to PCI config space.  Attempt to generalize some
      helpers to allow quirks to easily be added for mirrors and windows.
      Also fill in complete config space for AMD.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      39360f0b
  6. 04 7月, 2013 4 次提交
  7. 20 6月, 2013 2 次提交
  8. 09 4月, 2013 1 次提交
  9. 02 4月, 2013 8 次提交
    • A
      vfio: cleanup includes · 6dcfdbad
      Alex Williamson 提交于
      Starting to get messy, put the back in alphabetical order.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      6dcfdbad
    • A
      vfio: Add bootindex support · c29029dd
      Alex Williamson 提交于
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      c29029dd
    • A
      vfio-pci: Move devices to D0 on reset · ba661818
      Alex Williamson 提交于
      Guests may leave devices in a low power state at reboot, but we expect
      devices to be woken up for the next boot.  Make this happen.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      ba661818
    • A
      vfio-pci: Add extra debugging · 82ca8912
      Alex Williamson 提交于
      Often when debugging it's useful to be able to disable bypass paths
      so no interactions with the device are missed.  Add some extra debug
      options to do this.  Also add device info on read/write BAR accesses,
      which is useful when debugging more than one assigned device.  A
      couple DPRINTFs also had redundant "vfio:" prefixes.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      82ca8912
    • A
      qemu vfio-pci: Graphics device quirks · 7076eabc
      Alex Williamson 提交于
      Graphics cards have a number of different backdoors.  Some of these
      are alternative ways to get PCI BAR addresses, some of them are
      complete mirrors of PCI config space available through MMIO and
      I/O port access.  These quirks cover a number of ATI Radeon and
      Nvidia devices.  On the ATI/AMD side, this should enable HD5450
      and HD7850 and hopefully a host of devices around those generations.
      For Nvidia, my card selection is much more dated.  A 8400gs works
      well with both the Window shipped driver and the Nvidia downloaded
      driver.  A 7300le works as well, with the caveat that generating
      the Window experience index with the Nvidia driver causes the card
      to reset several times before generating a BSOD.  An NVS 290 card
      seems to run well with the shipped Windows driver, but generates
      a BSOD with the Nvidia driver.  All of the Nvidia devices work with
      the Linux Nvidia proprietary driver and nouveau, the HD5450 works
      with either radeon or fglrx, HD7850 works with vesa and fglrx (not
      supported by radeon).  Extremely limited 3D testing.
      
      Device reset is also an issue with graphics.  It's unfortunately
      very common that the devices offer no means to reset the card or
      doesn't seem effective.  Nvidia devices are pretty good about being
      able to get the device to a working state through the VGA BIOS init,
      Radeon devices less so, and often require a host reboot.  Work
      remains to be done here.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      7076eabc
    • A
      qemu vfio-pci: Add support for VGA MMIO and I/O port access · f15689c7
      Alex Williamson 提交于
      Most VGA cards need some kind of quirk to fully operate since they
      hide backdoors to get to other registers outside of PCI config space
      within the registers, but this provides the base infrastructure.  If
      we could identity map PCI resources for assigned devices we would need
      a lot fewer quirks.
      
      To enable this, use a kernel side vfio-pci driver that incorporates
      VGA support (v3.9), and use the -vga none option and add the x-vga=on
      option for the vfio-pci device.  The "x-" denotes this as an
      experimental feature.  You may also need to use a cached copy of the
      VGA BIOS for your device, passing it to vfio-pci using the romfile=
      option.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      f15689c7
    • A
      vfio-pci: Add PCIe capability mangling based on bus type · 96adc5c7
      Alex Williamson 提交于
      Windows seems to pay particular interest to the PCIe header type of
      devices and will fail to load drivers if we attach Endpoint devices or
      Legacy Endpoint devices to the Root Complex.  We can use
      pci_bus_is_express and pci_bus_is_root to determine the bus type and
      mangle the type appropriately:
      
      * Legacy PCI
        * No change, capability is unmodified for compatibility.
      * PCI Express
        * Integrated Root Complex Endpoint -> Endpoint
      * PCI Express Root Complex
        * Endpoint -> Integrated Root Complex Endpoint
        * Legacy Endpoint -> none, capability hidden
      
      We also take this opportunity to explicitly limit supported devices
      to Endpoints, Legacy Endpoints, and Root Complex Integrated Endpoints.
      We don't currently have support for other types and users often cause
      themselves problems by assigning them.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      96adc5c7
    • A
      vfio-pci: Generalize PCI config mangling · 4b5d5e87
      Alex Williamson 提交于
      Kernel-side vfio virtualizes all of config space, but some parts are
      unique to Qemu.  For instance we may or may not expose the ROM BAR,
      Qemu manages MSI/MSIX, and Qemu manages the multi-function bit so that
      single function devices can appear as multi-function and vica versa.
      Generalize this into a bitmap of Qemu emulated bits.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      4b5d5e87
  10. 01 3月, 2013 1 次提交
    • P
      hw: include hw header files with full paths · 83c9f4ca
      Paolo Bonzini 提交于
      Done with this script:
      
      cd hw
      for i in `find . -name '*.h' | sed 's/^..//'`; do
        echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,'
      done | sed -i -f - `find . -type f`
      
      This is so that paths remain valid as files are moved.
      
      Instead, files in hw/dataplane are referenced with the relative path.
      We know they are not going to move to include/, and they are the only
      include files that are in subdirectories _and_ move.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      83c9f4ca
  11. 11 2月, 2013 2 次提交
  12. 30 1月, 2013 1 次提交
  13. 09 1月, 2013 2 次提交
    • A
      vfio-pci: Loosen sanity checks to allow future features · 8fc94e5a
      Alex Williamson 提交于
      VFIO_PCI_NUM_REGIONS and VFIO_PCI_NUM_IRQS should never have been
      used in this manner as it locks a specific kernel implementation.
      Future features may introduce new regions or interrupt entries
      (VGA may add legacy ranges, AER might add an IRQ for error
      signalling).  Fix this before it gets us into trouble.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Cc: qemu-stable@nongnu.org
      8fc94e5a
    • A
      vfio-pci: Make host MSI-X enable track guest · b0223e29
      Alex Williamson 提交于
      Guests typically enable MSI-X with all of the vectors in the MSI-X
      vector table masked.  Only when the vector is enabled does the vector
      get unmasked, resulting in a vector_use callback.  These two points,
      enable and unmask, correspond to pci_enable_msix() and request_irq()
      for Linux guests.  Some drivers rely on VF/PF or PF/fw communication
      channels that expect the physical state of the device to match the
      guest visible state of the device.  They don't appreciate lazily
      enabling MSI-X on the physical device.
      
      To solve this, enable MSI-X with a single vector when the MSI-X
      capability is enabled and immediate disable the vector.  This leaves
      the physical device in exactly the same state between host and guest.
      Furthermore, the brief gap where we enable vector 0, it fires into
      userspace, not KVM, so the guest doesn't get spurious interrupts.
      Ideally we could call VFIO_DEVICE_SET_IRQS with the right parameters
      to enable MSI-X with zero vectors, but this will currently return an
      error as the Linux MSI-X interfaces do not allow it.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      Cc: qemu-stable@nongnu.org
      b0223e29
  14. 26 12月, 2012 1 次提交
  15. 19 12月, 2012 3 次提交
  16. 17 12月, 2012 1 次提交
  17. 11 12月, 2012 1 次提交
  18. 14 11月, 2012 2 次提交
  19. 23 10月, 2012 1 次提交
    • A
      Rename target_phys_addr_t to hwaddr · a8170e5e
      Avi Kivity 提交于
      target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are
      reserved) and its purpose doesn't match the name (most target_phys_addr_t
      addresses are not target specific).  Replace it with a finger-friendly,
      standards conformant hwaddr.
      
      Outstanding patchsets can be fixed up with the command
      
        git rebase -i --exec 'find -name "*.[ch]"
                              | xargs s/target_phys_addr_t/hwaddr/g' origin
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a8170e5e
  20. 22 10月, 2012 1 次提交
  21. 18 10月, 2012 2 次提交