23 Feb, 2016

4 commits

  • Provide read-only access to PCI config space of the PCI host bridge
    and LPC bridge through device specific regions. This may be used to
    configure a VM with matching register contents to satisfy driver
    requirements. Providing this through the vfio file descriptor removes
    an additional userspace requirement for access through pci-sysfs and
    removes the CAP_SYS_ADMIN requirement that doesn't appear to apply to
    the specific devices we're accessing.

    Signed-off-by: Alex Williamson

    Alex Williamson
     
  • This is the first consumer of vfio device specific resource support,
    providing read-only access to the OpRegion for Intel graphics devices.

    Signed-off-by: Alex Williamson

    Alex Williamson
     
  • Typically config space for a device is mapped out into capability
    specific handlers and unassigned space. The latter allows direct
    read/write access to config space. Sometimes we know about registers
    living in this void space and would like an easy way to virtualize
    them, similar to how BAR registers are managed. To do this, create
    one more pseudo (fake) PCI capability to be handled as purely virtual
    space. Reads and writes are serviced entirely from virtual config
    space.

    Signed-off-by: Alex Williamson

    Alex Williamson
     
  • Add support for additional regions with indexes started after the
    already defined fixed regions. Device specific code can register
    these regions with the new vfio_pci_register_dev_region() function.
    The ops structure per region currently only includes read/write
    access and a release function, allowing automatic cleanup when the
    device is closed. mmap support is only missing here because it's
    not needed by the first user queued for this support.

    Signed-off-by: Alex Williamson

    Alex Williamson
     

01 Oct, 2015

1 commit


17 Mar, 2015

2 commits

  • The virqfd functionality that is used by VFIO_PCI to implement interrupt
    masking and unmasking via an eventfd, is generic enough and can be reused
    by another driver. Move it to a separate file in order to allow the code
    to be shared.

    Signed-off-by: Antonios Motakis
    Signed-off-by: Baptiste Reynal
    Reviewed-by: Eric Auger
    Tested-by: Eric Auger
    Signed-off-by: Alex Williamson

    Antonios Motakis
     
  • The functions vfio_pci_virqfd_init and vfio_pci_virqfd_exit are not really
    PCI specific, since we plan to reuse the virqfd code with more VFIO drivers
    in addition to VFIO_PCI.

    Signed-off-by: Antonios Motakis
    [Baptiste Reynal: Move rename vfio_pci_virqfd_init and vfio_pci_virqfd_exit
    from "vfio: add a vfio_ prefix to virqfd_enable and virqfd_disable and export"]
    Signed-off-by: Baptiste Reynal
    Reviewed-by: Eric Auger
    Tested-by: Eric Auger
    Signed-off-by: Alex Williamson

    Antonios Motakis
     

11 Feb, 2015

1 commit

  • Userspace can opt to receive a device request notification,
    indicating that the device should be released. This is setup
    the same way as the error IRQ and also supports eventfd signaling.
    Future support may forcefully remove the device from the user if
    the request is ignored.

    Signed-off-by: Alex Williamson

    Alex Williamson
     

08 Aug, 2014

2 commits

  • Each time a device is released, mark whether a local reset was
    successful or whether a bus/slot reset is needed. If a reset is
    needed and all of the affected devices are bound to vfio-pci and
    unused, allow the reset. This is most useful when the userspace
    driver is killed and releases all the devices in an unclean state,
    such as when a QEMU VM quits.

    Signed-off-by: Alex Williamson

    Alex Williamson
     
  • Serializing open/release allows us to fix a refcnt error if we fail
    to enable the device and lets us prevent devices from being unbound
    or opened, giving us an opportunity to do bus resets on release. No
    restriction added to serialize binding devices to vfio-pci while the
    mutex is held though.

    Signed-off-by: Alex Williamson

    Alex Williamson
     

11 Mar, 2013

1 commit

  • - New VFIO_SET_IRQ ioctl option to pass the eventfd that is signaled when
    an error occurs in the vfio_pci_device

    - Register pci_error_handler for the vfio_pci driver

    - When the device encounters an error, the error handler registered by
    the vfio_pci driver gets invoked by the AER infrastructure

    - In the error handler, signal the eventfd registered for the device.

    - This results in the qemu eventfd handler getting invoked and
    appropriate action taken for the guest.

    Signed-off-by: Vijay Mohan Pandarathil
    Signed-off-by: Alex Williamson

    Vijay Mohan Pandarathil
     

19 Feb, 2013

1 commit

  • 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: Alex Williamson

    Alex Williamson
     

15 Feb, 2013

1 commit

  • We can actually handle MMIO and I/O port from the same access function
    since PCI already does abstraction of this. The ROM BAR only requires
    a minor difference, so it gets included too. vfio_pci_config_readwrite
    gets renamed for consistency.

    Signed-off-by: Alex Williamson

    Alex Williamson
     

31 Jul, 2012

1 commit

  • 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: Alex Williamson

    Alex Williamson