[RFC PATCH 07/15] PCI/TSM: Track Device Interface Report MMIO range index

From: Zhenzhong Duan

Date: Thu Sep 24 2026 - 00:13:00 EST


TDX Connect's TDG.MMIO.ACCEPT interface identifies an MMIO range
by its index in the Device Interface Report. Preserve this report
index when building pci_tsm_mmio entries.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@xxxxxxxxx>
---
drivers/pci/tsm/core.c | 1 +
include/linux/pci-tsm.h | 1 +
2 files changed, 2 insertions(+)

diff --git a/drivers/pci/tsm/core.c b/drivers/pci/tsm/core.c
index 19ad35f2da4a..3efb9c10d44b 100644
--- a/drivers/pci/tsm/core.c
+++ b/drivers/pci/tsm/core.c
@@ -754,6 +754,7 @@ struct pci_tsm_mmio *pci_tsm_mmio_alloc(struct pci_dev *pdev,
entry->res.start = range.start;
entry->res.end = range.end;
entry->tsm_offset = tsm_offset;
+ entry->index = i;
mmio->nr++;
}

diff --git a/include/linux/pci-tsm.h b/include/linux/pci-tsm.h
index be9f78ca2c1a..e5d9d7af2701 100644
--- a/include/linux/pci-tsm.h
+++ b/include/linux/pci-tsm.h
@@ -165,6 +165,7 @@ struct pci_tsm_pf0 {
struct pci_tsm_mmio_entry {
struct resource res;
u64 tsm_offset;
+ int index;
};

struct pci_tsm_mmio {
--
2.52.0