[Skiboot] [PATCH 0/3] PCI Virtual Device Support for NPU

Gavin Shan gwshan at linux.vnet.ibm.com
Tue Jul 5 12:30:08 AEST 2016


This series supports PCI virtual device. The motivation is to provide
functionality to support PCI virtual (emulated) device and it's used
by NVLink 1.0 and future NVLink 2.0. The NVLink (or NPU) driver needn't
have duplicated code to manage the PCI virtual device:

   * PCI virtual device is represented by "struct pci_virt_device". A
     PCI virtual device list is maintained in every PHB as the emulated
     PCI devices seats on root bus. PCI virtual device is identified by
     the assigned BDFN (Bus/Device/Function Number).
   * There are 3 config spaces for each PCI virtual device: the catched
     space, readonly space, w1c (write-1-to-clear) space. At the same time,
     the PCI config register filter mechanism is supported on PCI virtual
     device so that backends (e.g. npu.c) can emulate/trap access to the
     designated PCI config registers of the virtual device. If there are
     no PCI config register filters for the registers, the value from the
     cached config space is fetched and returned to user on read. Otherwise,
     the written value is pushed to the cached config space after bit-OR/AND
     with the corresponding bits in readonly and w1c space.
   * With PCI virtual device supported in PCI core, the npu.c needn't mantain
     the code to manage the emulated devices and their config space. PATCH[3/3]
     drops the code and reimplement it with generic PCI virtual device mechanism.

Gavin Shan (3):
  core/pci: Improve PCI config register filter
  core/pci: Support virtual device
  hw/npu: Use PCI virtual device

 core/Makefile.inc      |   6 +-
 core/pci-virt.c        | 260 ++++++++++++++++++++++++++++
 hw/npu-hw-procedures.c |  32 ++--
 hw/npu.c               | 450 +++++++++++++++----------------------------------
 hw/phb3.c              |  14 +-
 include/npu.h          |  22 +--
 include/pci-virt.h     |  85 ++++++++++
 include/pci.h          |   9 +-
 8 files changed, 518 insertions(+), 360 deletions(-)
 create mode 100644 core/pci-virt.c
 create mode 100644 include/pci-virt.h

-- 
2.1.0



More information about the Skiboot mailing list