[PATCH RFC 0/7] PCI/HMAT: Describe P2PDMA reachability and performance

Leon Romanovsky <[email protected]> Wed, 12 Aug 2026 22:47:37 +0300
Newsgroups gmane.linux.kernel.pci,gmane.linux.acpi.devel,gmane.linux.kernel
Message-ID <[email protected]>
Linux derives P2PDMA reachability from visible PCI topology, ACS
configuration, and a host-bridge whitelist. It cannot describe conditional
or slower cross-host-bridge paths; passthrough can hide the physical peer
relationships.

This RFC series implements the proposed ACPI HMAT Type 3 extension below.
Directional Generic Port matrices describe reachability, ordering, latency,
and bandwidth. Linux uses ordered paths to authorize P2PDMA and their
latency/bandwidth to rank providers. A VMM could translate these matrices
into guest domains; that is outside this series.

  HMAT Type 3 structure

  Field               Offset       Bytes  Meaning
  ---------------------------------------------------------------
  Type:                    0           2  value 3
  Length:                  4           4  entire structure
  Flags:                   8           1  traffic classes
  Data-type:               9           1  metric selector
  Initiators:             12           4  Generic Port count (s)
  Targets:                16           4  Generic Port count (t)
  Base-unit:              24           8  ps or MB/s; non-zero
  Initiator-PDs:          32         4*s  proximity-domain list
  Target-PDs:         32+4*s         4*t  proximity-domain list
  Matrix:         32+4*(s+t)       2*s*t  directional Entry[i][j]
  Reserved: bytes 2-3, 10-11, and 20-23

  Flags: encoding
    bit 0  non-UIO
    bit 1  UIO

  Metrics: selector
    0/1/2  access/read/write latency
    3/4/5  access/read/write bandwidth

  Direction: Initiator PD[i] -- Entry[i][j] metric --> Target PD[j]

----------------------------------------------------------------------
Based on [PATCH v3 00/17] PCI/P2PDMA: Fix ACS egress control handling
https://lore.kernel.org/all/[email protected]/

Signed-off-by: Leon Romanovsky <[email protected]>
---
Leon Romanovsky (7):
      ACPICA: Define PCIe P2P latency and bandwidth information
      ACPI: HMAT: Make PCIe P2P paths available to consumers
      PCI/P2PDMA: Authorize HMAT-described cross-host-bridge P2P
      PCI/P2PDMA: Prefer providers with better HMAT performance
      ACPI: HMAT: Add KUnit tests for PCIe P2P matrix semantics
      PCI/P2PDMA: Add KUnit tests for HMAT policy boundaries
      PCI/P2PDMA: Add KUnit tests for HMAT provider ranking

 drivers/acpi/numa/Kconfig     |  13 ++
 drivers/acpi/numa/Makefile    |   1 +
 drivers/acpi/numa/hmat.c      | 245 +++++++++++++++++++++-
 drivers/acpi/numa/hmat_test.c | 223 ++++++++++++++++++++
 drivers/acpi/numa/hmat_test.h |  17 ++
 drivers/pci/Kconfig           |  14 ++
 drivers/pci/Makefile          |   1 +
 drivers/pci/p2pdma.c          | 300 ++++++++++++++++++++------
 drivers/pci/p2pdma_test.c     | 477 ++++++++++++++++++++++++++++++++++++++++++
 drivers/pci/pci.h             |  23 ++
 include/acpi/actbl1.h         |  27 ++-
 include/linux/acpi.h          |  26 +++
 12 files changed, 1298 insertions(+), 69 deletions(-)
---
base-commit: bc5261fca94dd94ab557cc0852ce465d9c3ab8b0
change-id: 20260715-hmat-p2p-eb4971a9d731

Best regards,
--  
Leon Romanovsky <[email protected]>