Re: [RFC PATCH 07/15] PCI/TSM: Track Device Interface Report MMIO range index
From: Xiaoyao Li
Date: Sun Oct 25 2026 - 22:46:19 EST
On 9/24/2026 12:10 PM, Zhenzhong Duan wrote:
> 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.
If we are going to report it to the TSM guest framework series and ask that to
contain this change. It's better to put it at the beginning of this series and
state it as a prep patch instead of burying it in the middle.
> 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 {