From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOlpW-0000yI-ND for qemu-devel@nongnu.org; Tue, 02 Sep 2014 07:01:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOlpP-0001Sv-Ps for qemu-devel@nongnu.org; Tue, 02 Sep 2014 07:00:54 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOlpP-0001Si-JJ for qemu-devel@nongnu.org; Tue, 02 Sep 2014 07:00:47 -0400 From: Knut Omang Date: Tue, 2 Sep 2014 13:00:02 +0200 Message-Id: <1409655606-19150-1-git-send-email-knut.omang@oracle.com> Subject: [Qemu-devel] [PATCH v2 0/4] pcie: Add support for Single Root I/O Virtualization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , Stefan Hajnoczi , "Michael S. Tsirkin" , Laszlo Ersek , Gabriel Somlo , Knut Omang , Alexander Graf , Fabien Chouteau , Luiz Capitulino , Beniamino Galvani , Alex Williamson , "Gonglei (Arei)" , Jan Kiszka , Anthony Liguori , Paolo Bonzini , Amos Kong This patch set implements generic support for SR/IOV as an extension to the core PCIe functionality, similar to the way other capabilities such as AER is implemented. There is no implementation of any device that provides SR/IOV support included, but I have implemented a test example which can be found together with this patch set here: git://github.com/knuto/qemu.git sriov_patches_v2 Testing with this example device documented here: http://lists.nongnu.org/archive/html/qemu-devel/2014-08/msg05110.html Changes since v1: - Rebased on top of latest master, eliminating prereqs. - Implement proper support for VF_STRIDE, VF_OFFSET and SUP_PGSIZE Time better spent fixing it than explaining what the previous limitations were. - Added new first patch to fix pci bug related to this - Split out patch to pci_default_config_write to a separate patch 2 to highlight bug fix. - Refactored out logic into new source files hw/pci/pcie_sriov.c include/hw/pci/pcie_sriov.h similar to pcie_aer.c/h. - Rename functions and introduce structs to better separate pf and vf functionality. - Replaced is_vf member with pci_is_vf() function abstraction - Fix numerous syntax, whitespace and comment issues according to Michael's review. - Fix memory leaks. - Removed igb example device - a rebased version available on github instead. Knut Omang (4): pci: Make use of the devfn property when registering new devices pci: Avoid losing config updates to MSI/MSIX cap regs pci: Update pci_regs header pcie: Add support for Single Root I/O Virtualization (SR/IOV) hw/i386/kvm/pci-assign.c | 4 +- hw/misc/vfio.c | 8 +- hw/pci/Makefile.objs | 2 +- hw/pci/msi.c | 4 - hw/pci/msix.c | 2 +- hw/pci/pci.c | 106 +++++++++---- hw/pci/pcie.c | 9 +- hw/pci/pcie_sriov.c | 267 +++++++++++++++++++++++++++++++ include/hw/pci/pci.h | 11 +- include/hw/pci/pci_regs.h | 371 +++++++++++++++++++++++++++++++++----------- include/hw/pci/pcie.h | 6 + include/hw/pci/pcie_sriov.h | 55 +++++++ include/qemu/typedefs.h | 2 + 13 files changed, 708 insertions(+), 139 deletions(-) create mode 100644 hw/pci/pcie_sriov.c create mode 100644 include/hw/pci/pcie_sriov.h -- 1.9.0