From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZZXi-0002G1-Eg for qemu-devel@nongnu.org; Tue, 16 Aug 2016 04:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZZXc-0005FI-Kn for qemu-devel@nongnu.org; Tue, 16 Aug 2016 04:16:13 -0400 Received: from mga04.intel.com ([192.55.52.120]:24642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZZXc-0005FC-Er for qemu-devel@nongnu.org; Tue, 16 Aug 2016 04:16:08 -0400 From: Jike Song Date: Tue, 16 Aug 2016 16:14:12 +0800 Message-Id: <1471335257-6226-1-git-send-email-jike.song@intel.com> Subject: [Qemu-devel] [RFC v6-based v1 0/5] refine mdev framework List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex.williamson@redhat.com, kwankhede@nvidia.com, cjia@nvidia.com Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, bjsdjshi@linux.vnet.ibm.com, kevin.tian@intel.com, guangrong.xiao@linux.intel.com, zhenyuw@linux.intel.com, jike.song@intel.com, pbonzini@redhat.com, kraxel@redhat.com This patchset is based on NVidia's "Add Mediated device support" series, version 6: http://www.spinics.net/lists/kvm/msg136472.html Background: The patchset from NVidia introduced the Mediated Device support to Linux/VFIO. With that series, one can create virtual devices (supporting by underlying physical device and vendor driver), and assign them to userspace like QEMU/KVM, in the same way as device assignment via VFIO. Based on that, NVidia and Intel implemented their vGPU solutions, IBM implemented its CCW pass-through. However, there are limitations imposed by current (v6 in particular) mdev framework: the mdev must be represented as a PCI device, several vfio capabilities such as sparse mmap are not possible, and so forth. This series aims to address above limitations and simplify the implementation. Key Changes: - An independent "struct device" was introduced to parent_device, thus a hierarchy in driver core is formed with physical device, parent device and mdev device; - Leveraging the mechanism and APIs provided by Linux driver core, it is now safe to remove all refcnts and locks; - vfio_mpci (later renamed to vfio_mdev) was made BUS-agnostic: all PCI-specific logic was removed, accesses from userspace are now passed to vendor driver directly, thus guaranteed that full VFIO capabilities provided: e.g. dynamic regions, sparse mmap, etc.; With vfio_mdev being BUS-agnostic, it is enough to have only one driver for all mdev devices; - UUID was removed from the interface between mdev and vendor driver; TODO remove mdev stuff from vfio.h update doc Jike Song (3): mdev: remove uuid from parent_ops vfio_mpci: remove PCI-specific logic rename 'vfio_mpci' to 'vfio_mdev' since it is now BUS-agnostic Xiao Guangrong (2): mdev: create separate device for parent_device mdev: drop management information and utilize driver-core instead drivers/vfio/mdev/Kconfig | 10 +- drivers/vfio/mdev/Makefile | 5 +- drivers/vfio/mdev/mdev_core.c | 483 +++++--------------------------- drivers/vfio/mdev/mdev_private.h | 9 +- drivers/vfio/mdev/mdev_sysfs.c | 82 ++---- drivers/vfio/mdev/vfio_mdev.c | 168 +++++++++++ drivers/vfio/mdev/vfio_mpci.c | 536 ------------------------------------ drivers/vfio/pci/vfio_pci_private.h | 6 + include/linux/mdev.h | 87 ++---- include/linux/vfio.h | 7 - 10 files changed, 302 insertions(+), 1091 deletions(-) create mode 100644 drivers/vfio/mdev/vfio_mdev.c delete mode 100644 drivers/vfio/mdev/vfio_mpci.c -- 1.9.1