Skip to content

VFIO mdev aggregated resources handling

Zhenyu Wang kvm 3 versions – NAK

Status from this message: Nak, this is inherently racy. Just imagine two processes trying to

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 19 repliesNAK
  2. v22 patches 9 repliesSuperseded
  3. v16 patches 21 repliesSuperseded

Changes in v3 from the cover letter

- add more description for sysfs entries
- rebase GVT support
- rename accounting function

Patches in v3

#Subject and filesSizeRepliesApplied
1/2Documentation/driver-api/vfio-mediated-device.rst: update for aggregation supportDocumentation/driver-api/vfio-mediated-device.rst+22 -00 replies
2/2drm/i915/gvt: mdev aggregation typedrivers/gpu/drm/i915/gvt/aperture_gm.c drivers/gpu/drm/i915/gvt/gtt.c drivers/gpu/drm/i915/gvt/gvt.c +3 more+295 -940 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] VFIO mdev aggregated resources handling

Hi,

This is a refresh on previous series: https://patchwork.kernel.org/cover/11208279/
and https://patchwork.freedesktop.org/series/70425/

Current mdev device create interface depends on fixed mdev type, which get uuid from user to create instance of mdev device. If user wants to use customized number of resource for mdev device, then only can create new mdev type for that which may not be flexible. This requirement comes not only from to be able to allocate flexible resources for KVMGT, but also from Intel scalable IO virtualization which would use vfio/mdev to be able to allocate arbitrary resources on mdev instance. More info on [1] [2] [3].

As we agreed that for current opaque mdev device type, we'd still explore management interface based on mdev sysfs definition. And this one tries to follow Alex's previous suggestion to create generic parameters under 'mdev' directory for each device, so vendor driver could provide support like as other defined mdev sysfs entries.

For mdev type with aggregation support, files as "aggregated_instances" and "max_aggregation" should be created under 'mdev' directory. E.g

/sys/devices/pci0000:00/0000:00:02.0/<UUID>/mdev/
|-- aggregated_instances
|-- max_aggregation

"aggregated_instances" is used to set or return current number of instances for aggregation, which can not be larger than "max_aggregation".

The first patch is to update the document for new mdev parameter directory. The second one is to add aggregation support in GVT driver.

References:
[1] https://software.intel.com/en-us/download/intel-virtualization-technology-for-directed-io-architecture-specification
[2] https://software.intel.com/en-us/download/intel-scalable-io-virtualization-technical-specification
[3] https://schd.ws/hosted_files/lc32018/00/LC3-SIOV-final.pdf

Changelog:
v3:
- add more description for sysfs entries
- rebase GVT support
- rename accounting function

Zhenyu Wang (2):
Documentation/driver-api/vfio-mediated-device.rst: update for
aggregation support
drm/i915/gvt: mdev aggregation type

 .../driver-api/vfio-mediated-device.rst       |  22 +++
 drivers/gpu/drm/i915/gvt/aperture_gm.c        |  44 +++--
 drivers/gpu/drm/i915/gvt/gtt.c                |   9 +-
 drivers/gpu/drm/i915/gvt/gvt.c                |   7 +-
 drivers/gpu/drm/i915/gvt/gvt.h                |  42 +++--
 drivers/gpu/drm/i915/gvt/kvmgt.c              | 115 +++++++++++-
 drivers/gpu/drm/i915/gvt/vgpu.c               | 172 ++++++++++++------
 7 files changed, 317 insertions(+), 94 deletions(-)
Signature · 1 line
2.25.1