[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 00/15] PCI SBDF Refactoring



The goal of this series is to make some refactoring of some
pci primitives to improve codegen and make code less verbose.

A big chunk of it is converting many places where (seg, bus, dev, fn)
is split into multiples variables and into being just pci_sbdf_t,
in particular in some PCI function parameters to reduce parameter count
which usually translate into less registers to pass to the function.
Moreover, we also avoid translating back and forth between pci_sbdf_t
and individual (seg, bus, dev, fn).

No major functional change, aside some parts of the codebase that will
now correctly handle PCI segment when parsed while it was previously
ignored (e.g dbgp).

---
CI: https://gitlab.com/xen-project/people/tsnake41/xen/-/pipelines/2611829865

v2:
 * Dropped "Migrate pci_mmcfg_{read,write}() to pci.c", to be moved in
   a separate series
 * fixed dev_sbdf calculation in acpi_parse_dev_scope() 
 * Updated documentation on ehci_dbgp now accepting segment parameter
   (but I'm not sure it suffice to allow this interface to use non-0 segments)
 * Introduced similar changes for pci_prepare_msix(), pci_ro_device(),
   pci_hide_device(), pci_remove_device(), pci_add_device()
   and pci_check_disable_device()
 * Use pci_sbdf_t in struct ehci_dbgp
 * Introduced "vtd: Rewrite igd device check in acpi_parse_dev_scope()"
 * Introduced docs change (RFC)

Teddy Astie (15):
  pci: Introduce parse_pci_sbdf{_seg}()
  vtd: Use pci_sbdf_t in acpi_parse_dev_scope()
  pci: Use pci_sbdf_t in pci_device_detect()
  pci: Parse into pci_sbdf_t directly
  pci: Allow ommiting func when parsing with parse_pci_sbdf()
  pci: Use pci_sbdf_t in pci_prepare_msix()
  pci: Use pci_sbdf_t in pci_ro_device()
  pci: Use pci_sbdf_t in pci_hide_device()
  pci: Use pci_sbdf_t in pci_remove_device()
  pci: Use pci_sbdf_t in pci_add_device()
  vtd: Rewrite igd device check in acpi_parse_dev_scope()
  pci: Use pci_sbdf_t pci_check_disable_device()
  pci: Drop parse_pci{_seg}()
  ehci-dbgp: Use pci_sbdf_t instead of (bus, slot, func)
  RFC: docs: Document support for PCI segment in dbgp and comN parameter

 docs/misc/xen-command-line.pandoc          | 16 ++--
 xen/arch/x86/include/asm/msi.h             |  2 +-
 xen/arch/x86/msi.c                         |  4 +-
 xen/arch/x86/physdev.c                     | 20 +++--
 xen/drivers/char/ehci-dbgp.c               | 98 ++++++++--------------
 xen/drivers/char/ns16550.c                 | 27 +++---
 xen/drivers/char/xhci-dbc.c                | 12 +--
 xen/drivers/passthrough/amd/iommu_acpi.c   | 26 +++---
 xen/drivers/passthrough/amd/iommu_detect.c |  7 +-
 xen/drivers/passthrough/amd/iommu_init.c   |  3 +-
 xen/drivers/passthrough/pci.c              | 88 ++++++++++---------
 xen/drivers/passthrough/vtd/dmar.c         | 81 +++++++-----------
 xen/drivers/passthrough/vtd/iommu.c        |  3 +-
 xen/drivers/pci/pci.c                      | 40 +++------
 xen/drivers/pci/physdev.c                  |  4 +-
 xen/drivers/video/vga.c                    |  2 +-
 xen/include/xen/pci.h                      | 20 ++---
 17 files changed, 190 insertions(+), 263 deletions(-)

-- 
2.54.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.