qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 7df938: vfio: Add sysfsdev property for pci &


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7df938: vfio: Add sysfsdev property for pci & platform
Date: Mon, 14 Mar 2016 09:00:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7df9381b7aa56c897e344f3bfe43bf5848bbd3e0
      
https://github.com/qemu/qemu/commit/7df9381b7aa56c897e344f3bfe43bf5848bbd3e0
  Author: Alex Williamson <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Add sysfsdev property for pci & platform

vfio-pci currently requires a host= parameter, which comes in the
form of a PCI address in [domain:]<bus:slot.function> notation.  We
expect to find a matching entry in sysfs for that under
/sys/bus/pci/devices/.  vfio-platform takes a similar approach, but
defines the host= parameter to be a string, which can be matched
directly under /sys/bus/platform/devices/.  On the PCI side, we have
some interest in using vfio to expose vGPU devices.  These are not
actual discrete PCI devices, so they don't have a compatible host PCI
bus address or a device link where QEMU wants to look for it.  There's
also really no requirement that vfio can only be used to expose
physical devices, a new vfio bus and iommu driver could expose a
completely emulated device.  To fit within the vfio framework, it
would need a kernel struct device and associated IOMMU group, but
those are easy constraints to manage.

To support such devices, which would include vGPUs, that honor the
VFIO PCI programming API, but are not necessarily backed by a unique
PCI address, add support for specifying any device in sysfs.  The
vfio API already has support for probing the device type to ensure
compatibility with either vfio-pci or vfio-platform.

With this, a vfio-pci device could either be specified as:

-device vfio-pci,host=02:00.0

or

-device vfio-pci,sysfsdev=/sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0

or even

-device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:02:00.0

When vGPU support comes along, this might look something more like:

-device vfio-pci,sysfsdev=/sys/devices/virtual/intel-vgpu/address@hidden:00:02.0

NB - This is only a made up example path

The same change is made for vfio-platform, specifying sysfsdev has
precedence over the old host option.

Tested-by: Eric Auger <address@hidden>
Reviewed-by: Eric Auger <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 469002263a295ec471c1498c3b456ccd9f85a841
      
https://github.com/qemu/qemu/commit/469002263a295ec471c1498c3b456ccd9f85a841
  Author: Alex Williamson <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Wrap VFIO_DEVICE_GET_REGION_INFO

In preparation for supporting capability chains on regions, wrap
ioctl(VFIO_DEVICE_GET_REGION_INFO) so we don't duplicate the code for
each caller.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: db0da029a1853d46c90a6c0790ce6ca77fd46ea3
      
https://github.com/qemu/qemu/commit/db0da029a1853d46c90a6c0790ce6ca77fd46ea3
  Author: Alex Williamson <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/arm/sysbus-fdt.c
    M hw/vfio/common.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h
    M trace-events

  Log Message:
  -----------
  vfio: Generalize region support

Both platform and PCI vfio drivers create a "slow", I/O memory region
with one or more mmap memory regions overlayed when supported by the
device. Generalize this to a set of common helpers in the core that
pulls the region info from vfio, fills the region data, configures
slow mapping, and adds helpers for comleting the mmap, enable/disable,
and teardown.  This can be immediately used by the PCI MSI-X code,
which needs to mmap around the MSI-X vector table.

This also changes VFIORegion.mem to be dynamically allocated because
otherwise we don't know how the caller has allocated VFIORegion and
therefore don't know whether to unreference it to destroy the
MemoryRegion or not.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: 2d82f8a3cdb276bc3cb92d6f01bf8f66bf328d62
      
https://github.com/qemu/qemu/commit/2d82f8a3cdb276bc3cb92d6f01bf8f66bf328d62
  Author: Alex Williamson <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions

Match common vfio code with setup, exit, and finalize functions for
BAR, quirk, and VGA management.  VGA is also changed to dynamic
allocation to match the other MemoryRegions.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: e2e5ee9c5652ea1a3c2021a2ec79a3bc6a3b0c51
      
https://github.com/qemu/qemu/commit/e2e5ee9c5652ea1a3c2021a2ec79a3bc6a3b0c51
  Author: Alex Williamson <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Fixup PCI option ROMs

Devices like Intel graphics are known to not only have bad checksums,
but also the wrong device ID.  This is not so surprising given that
the video BIOS is typically part of the system firmware image rather
that embedded into the device and needs to support any IGD device
installed into the system.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: e593c0211b8a9e47d3fd24d2be5900ecf5a03b03
      
https://github.com/qemu/qemu/commit/e593c0211b8a9e47d3fd24d2be5900ecf5a03b03
  Author: Alex Williamson <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Split out VGA setup

This could be setup later by device specific code, such as IGD
initialization.

Signed-off-by: Alex Williamson <address@hidden>


  Commit: 062ed5d8d6edcba9cb8daecc764b7dcedf3e1009
      
https://github.com/qemu/qemu/commit/062ed5d8d6edcba9cb8daecc764b7dcedf3e1009
  Author: Neo Jia <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: replace fixed string limit by g_strdup_printf

A trivial change to remove string limit by using g_strdup_printf

Tested-by: Neo Jia <address@hidden>
Signed-off-by: Neo Jia <address@hidden>
Signed-off-by: Kirti Wankhede <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 99b88c6d1fc81c9757bb6e116e0adf20b2906629
      
https://github.com/qemu/qemu/commit/99b88c6d1fc81c9757bb6e116e0adf20b2906629
  Author: Thomas Huth <address@hidden>
  Date:   2016-03-10 (Thu, 10 Mar 2016)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Add entry for the include/hw/vfio/ folder

The headers in include/hw/vfio/ should be listed in the VFIO
section of the MAINTAINERS file.

Signed-off-by: Thomas Huth <address@hidden>
Signed-off-by: Alex Williamson <address@hidden>


  Commit: 6dcea614251e01d99c352056baffed6b39bd4b26
      
https://github.com/qemu/qemu/commit/6dcea614251e01d99c352056baffed6b39bd4b26
  Author: Peter Maydell <address@hidden>
  Date:   2016-03-14 (Mon, 14 Mar 2016)

  Changed paths:
    M MAINTAINERS
    M hw/arm/sysbus-fdt.c
    M hw/vfio/common.c
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h
    M trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20160311.0' 
into staging

VFIO updates 2016-03-11

 - Allow devices to be specified via sysfs path (Alex Williamson)
 - vfio region helpers and generalization for future device specific regions
   (Alex Williamson)
 - Automatic ROM device ID and checksum fixup (Alex Williamson)
 - Split VGA setup to allow enabling VGA from quirks (Alex Williamson)
 - Remove fixed string limit for ROM MemoryRegion name (Neo Jia)
 - MAINTAINERS update (Thomas Huth)

# gpg: Signature made Fri 11 Mar 2016 15:55:31 GMT using RSA key ID 3BB08B22
# gpg: Good signature from "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"

* remotes/awilliam/tags/vfio-update-20160311.0:
  MAINTAINERS: Add entry for the include/hw/vfio/ folder
  vfio/pci: replace fixed string limit by g_strdup_printf
  vfio/pci: Split out VGA setup
  vfio/pci: Fixup PCI option ROMs
  vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions
  vfio: Generalize region support
  vfio: Wrap VFIO_DEVICE_GET_REGION_INFO
  vfio: Add sysfsdev property for pci & platform

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/0dcee62261cb...6dcea614251e

reply via email to

[Prev in Thread] Current Thread [Next in Thread]