Skip to content

vpci: PCI config space emulation

Roger Pau Monne xen-devel 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v12 Latest12 patches 1 replyIn review
  2. v1112 patches 10 repliesSuperseded
  3. v1011 patches 18 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v911 patches21 repliesSuperseded
v811 patches12 repliesSuperseded
v712 patches21 repliesSuperseded
v611 patches39 repliesSuperseded
v511 patches48 repliesSuperseded
v48 of 9 patches35 repliesSuperseded
v39 patches39 repliesSuperseded
v29 patches30 repliesSuperseded

Patches in v12 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12vpci: introduce basic handlers to trap accesses to the PCI config space.gitignore tools/libxl/libxl_x86.c tools/tests/Makefile +21 more+1169 -70 replies
2/12x86/mmcfg: add handlers for the PVH Dom0 MMCFG areasxen/arch/x86/hvm/dom0_build.c xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/io.c +4 more+225 -50 replies
3/12x86/physdev: enable PHYSDEVOP_pci_mmcfg_reserved for PVH Dom0xen/arch/x86/hvm/hypercall.c xen/arch/x86/hvm/io.c xen/arch/x86/physdev.c+27 -50 replies
4/12pci: split code to size BARs from pci_add_devicexen/drivers/passthrough/pci.c xen/include/xen/pci.h+65 -340 replies
5/12pci: add support to size ROM BARs to pci_size_mem_barxen/drivers/passthrough/pci.c xen/include/xen/pci.h+15 -140 replies
6/12xen: introduce rangeset_consume_rangesxen/common/rangeset.c xen/include/xen/rangeset.h+38 -00 replies
7/12vpci: add header handlerstools/tests/vpci/emul.h xen/arch/x86/hvm/ioreq.c xen/drivers/vpci/Makefile +4 more+648 -140 replies
8/12x86/pt: mask MSI vectors on unbindxen/drivers/passthrough/io.c+15 -00 replies
9/12vpci/msi: add MSI handlersxen/arch/x86/hvm/vmsi.c xen/arch/x86/msi.c xen/drivers/vpci/Makefile +6 more+518 -10 replies
10/12vpci: add a priority parameter to the vPCI register initializerxen/arch/arm/xen.lds.S xen/arch/x86/xen.lds.S xen/drivers/vpci/header.c +2 more+12 -81 reply
11/12vpci/msix: add MSI-X handlersxen/arch/x86/hvm/dom0_build.c xen/arch/x86/hvm/hvm.c xen/arch/x86/hvm/vmsi.c +8 more+720 -310 replies
12/12vpci: do not expose unneeded functions to the user-space test harnesstools/tests/vpci/Makefile xen/drivers/vpci/vpci.c xen/include/xen/vpci.h+9 -150 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchPaul DurrantJan BeulichWei LiuJulien Grall
1/12R-b R-b A-b A-b
2/12R-b R-b
3/12R-b R-b
4/12R-b
5/12R-b
6/12R-b
7/12R-b R-b
8/12R-b
9/12R-b R-b
10/12R-b A-b
11/12R-b R-b
12/12Requested-by R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v12 thread

Cover letter [PATCH v12 00/12] vpci: PCI config space emulation

Hello,

The following series contain an implementation of handlers for the PCI configuration space inside of Xen. This allows Xen to detect accesses to the PCI configuration space and react accordingly.

Why is this needed? IMHO, there are two main points of doing all this emulation inside of Xen, the first one is to prevent adding a bunch of duplicated Xen PV specific code to each OS we want to support in PVH mode. This just promotes Xen code duplication amongst OSes, which leads to a higher maintainership burden.

The second reason would be that this code (or it's functionality to be more precise) already exists in QEMU (and pciback to a degree), and it's code that we already support and maintain. By moving it into the hypervisor itself every guest type can make use of it, and should be shared between them all. I know that the code in this series is not yet suitable for DomU HVM guests in it's current state, but it should be in due time.

As usual, each patch contains a changeset summary between versions, I'm not going to copy the list of changes here.

The branch containing the patches can be found at:

git://xenbits.xen.org/people/royger/xen.git vpci_v11

Note that this is only safe to use for the hardware domain (that's trusted), any non-trusted domain will need a lot more handlers before it can freely access the PCI configuration space.

Roger Pau Monne (12):
vpci: introduce basic handlers to trap accesses to the PCI config
space
x86/mmcfg: add handlers for the PVH Dom0 MMCFG areas x86/physdev: enable PHYSDEVOP_pci_mmcfg_reserved for PVH Dom0
pci: split code to size BARs from pci_add_device
pci: add support to size ROM BARs to pci_size_mem_bar
xen: introduce rangeset_consume_ranges
vpci: add header handlers
x86/pt: mask MSI vectors on unbind
vpci/msi: add MSI handlers
vpci: add a priority parameter to the vPCI register initializer vpci/msix: add MSI-X handlers
vpci: do not expose unneeded functions to the user-space test harness

 .gitignore                        |   3 +
 tools/libxl/libxl_x86.c           |   2 +-
 tools/tests/Makefile              |   1 +
 tools/tests/vpci/Makefile         |  33 +++
 tools/tests/vpci/emul.h           | 134 +++++++++
 tools/tests/vpci/main.c           | 309 +++++++++++++++++++++
 xen/arch/arm/xen.lds.S            |  14 +
 xen/arch/x86/Kconfig              |   1 +
 xen/arch/x86/domain.c             |   6 +-
 xen/arch/x86/hvm/dom0_build.c     |  23 +-
 xen/arch/x86/hvm/hvm.c            |   7 +
 xen/arch/x86/hvm/hypercall.c      |   5 +
 xen/arch/x86/hvm/io.c             | 293 ++++++++++++++++++++
 xen/arch/x86/hvm/ioreq.c          |   4 +
 xen/arch/x86/hvm/vmsi.c           | 246 +++++++++++++++++
 xen/arch/x86/msi.c                |   3 +
 xen/arch/x86/physdev.c            |  11 +
 xen/arch/x86/setup.c              |   2 +-
 xen/arch/x86/x86_64/mmconfig.h    |   4 -
 xen/arch/x86/xen.lds.S            |  14 +
 xen/common/rangeset.c             |  28 ++
 xen/drivers/Kconfig               |   3 +
 xen/drivers/Makefile              |   1 +
 xen/drivers/passthrough/io.c      |  15 +
 xen/drivers/passthrough/pci.c     | 104 ++++---
 xen/drivers/vpci/Makefile         |   1 +
 xen/drivers/vpci/header.c         | 564 ++++++++++++++++++++++++++++++++++++++
 xen/drivers/vpci/msi.c            | 349 +++++++++++++++++++++++
 xen/drivers/vpci/msix.c           | 458 +++++++++++++++++++++++++++++++
 xen/drivers/vpci/vpci.c           | 482 ++++++++++++++++++++++++++++++++
 xen/include/asm-x86/domain.h      |   1 +
 xen/include/asm-x86/hvm/domain.h  |   7 +
 xen/include/asm-x86/hvm/io.h      |  20 ++
 xen/include/asm-x86/msi.h         |   3 +
 xen/include/asm-x86/pci.h         |   6 +
 xen/include/public/arch-x86/xen.h |   5 +-
 xen/include/xen/irq.h             |   1 +
 xen/include/xen/pci.h             |   9 +
 xen/include/xen/pci_regs.h        |   8 +
 xen/include/xen/rangeset.h        |  10 +
 xen/include/xen/sched.h           |   4 +
 xen/include/xen/vpci.h            | 225 +++++++++++++++
 42 files changed, 3373 insertions(+), 46 deletions(-)
 create mode 100644 tools/tests/vpci/Makefile
 create mode 100644 tools/tests/vpci/emul.h
 create mode 100644 tools/tests/vpci/main.c
 create mode 100644 xen/drivers/vpci/Makefile
 create mode 100644 xen/drivers/vpci/header.c
 create mode 100644 xen/drivers/vpci/msi.c
 create mode 100644 xen/drivers/vpci/msix.c
 create mode 100644 xen/drivers/vpci/vpci.c
 create mode 100644 xen/include/xen/vpci.h
Signature · 7 lines
2.16.2


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel