linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: <linux-coco@lists.linux.dev>, <linux-pci@vger.kernel.org>
Cc: gregkh@linuxfoundation.org, lukas@wunner.de,
	aneesh.kumar@kernel.org, suzuki.poulose@arm.com,
	sameo@rivosinc.com, aik@amd.com, jgg@nvidia.com, zhiw@nvidia.com,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Dexuan Cui" <decui@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Isaku Yamahata" <isaku.yamahata@intel.com>,
	"John Allen" <john.allen@amd.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Nirmal Patel" <nirmal.patel@linux.intel.com>,
	"Rob Herring" <robh@kernel.org>,
	"Tom Lendacky" <thomas.lendacky@amd.com>,
	"Wei Liu" <wei.liu@kernel.org>,
	"Xiaoyao Li" <xiaoyao.li@intel.com>,
	"Xu Yilun" <yilun.xu@linux.intel.com>,
	"Yilun Xu" <yilun.xu@intel.com>
Subject: [PATCH v3 00/13] PCI/TSM: Core infrastructure for PCI device security (TDISP)
Date: Thu, 15 May 2025 22:47:19 -0700	[thread overview]
Message-ID: <20250516054732.2055093-1-dan.j.williams@intel.com> (raw)

Changes since v2 [1]:
- drivers/virt/coco/guest rename merged to tsm.git#next
- Clarify usage and requirements for pci_ide_init_nr_streams() (Dionna)
- Misc fixups (Dionna)
- Fix sel_ide_offset() to incorporate ide_cap (Aneesh, Yilun)
- Allow at least 1 stream when enforcing uniform address association
  register layout (Yilun)
- Fix host-bridge-emulation for PCI_DOMAINS_GENERIC platform (Suzuki)
- Export pci_ide_to_settings() as a helper for TSM drivers (Yilun)
- Set Stream ID early, prior to IDE_KM (Alexey)
- Catch IDE_KM initial setup failures with pci_ide_stream_enable()
  errors (Yilun).
- Fix missing initialization of nr_link_ide (caught by
  samples/devsec/bus test)
- Add some reference documentation to the devsec_tsm_connect() sample
  operation to clarify implementation expectations (Zhi)
- Expand the possible Device Security Managers from only PF0 of a device
  hosting TDIs, to include Upstream Ports with downstream endpoints as
  TDIs
- Add bind, unbind, guest_req, and accept operations (Yilun)

[1]: http://lore.kernel.org/174107245357.1288555.10863541957822891561.stgit@dwillia2-xfh.jf.intel.com

Launch of tsm.git#staging [2]
-----------------------------
As mentioned on v2, tsm.git#staging is proposed as a neutral location to
collect device-security infrastructure from multiple vendors. I.e.
collect all the vendor trees to resolve conflicts, code or otherwise.
For now it does not contain kvm-coco-queue, but am open to merging that
if needed for some device-security-flows.

Yilun showed a potential flow for the end-to-end API changes here [1],
do review that and point out where it may not work for a different
architecture. A goal of mine is to catch sample/devsec/ up with that
diagram to prove out and unit test the end-to-end mechanism without
needing hardware. It has already found bugs while revising this new set.

[2]: https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git/log/?h=staging
[3]: http://lore.kernel.org/aCYsNSFQJZzHVOFI@yilunxu-OptiPlex-7050

Original Cover letter:
----------------------

Trusted execution environment (TEE) Device Interface Security Protocol
(TDISP) is a chapter name in the PCI specification. It describes an
alphabet soup of mechanisms, SPDM, CMA, IDE, TSM/DSM, that system
software uses to establish trust in a device and assign it to a
confidential virtual machine (CVM). It is protocol for dynamically
extending the trusted computing boundary (TCB) of a CVM with a PCI
device interface that can issue DMA to CVM private memory.

The acronym soup problem is enhanced by every major platform vendor
having distinct TEE Security Manager (TSM) API implementations /
capabilities, and to a lesser extent, every potential endpoint Device
Security Manager (DSM) having its own idiosyncratic behaviors around
TDISP state transitions.

Despite all that opportunity for differentiation, there is a significant
portion of the implementation that is cross-vendor common. However, it
is difficult to develop, debate, test and settle all those pieces absent
a low level TSM driver implementation to pull it all together.

The proposal is incrementally develop the shared infrastructure on top
of a sample TSM driver implementation to enable clean vendor agnostic
discussions about the commons. "samples/devsec/" is meant to be: just
enough emulation to exercise all the core infrastructure, a reference
implementation, and a simple unit test. The sample also enables
coordination with the native PCI device security effort [4].

[4]: http://lore.kernel.org/cover.1719771133.git.lukas@wunner.de

Dan Williams (11):
  coco/tsm: Introduce a core device for TEE Security Managers
  PCI/IDE: Enumerate Selective Stream IDE capabilities
  PCI/TSM: Authenticate devices via platform TSM
  PCI: Enable host-bridge emulation for PCI_DOMAINS_GENERIC platforms
  PCI: vmd: Switch to pci_bus_find_emul_domain_nr()
  samples/devsec: Introduce a PCI device-security bus + endpoint sample
  PCI: Add PCIe Device 3 Extended Capability enumeration
  PCI/IDE: Add IDE establishment helpers
  PCI/IDE: Report available IDE streams
  PCI/TSM: Report active IDE streams
  samples/devsec: Add sample IDE establishment

Xu Yilun (2):
  PCI/TSM: support TDI related operations for host TSM driver
  PCI/TSM: Add Guest TSM Support

 Documentation/ABI/testing/sysfs-bus-pci       |  45 +
 Documentation/ABI/testing/sysfs-class-tsm     |  20 +
 .../ABI/testing/sysfs-devices-pci-host-bridge |  51 ++
 MAINTAINERS                                   |   7 +-
 drivers/pci/Kconfig                           |  28 +
 drivers/pci/Makefile                          |   2 +
 drivers/pci/controller/pci-hyperv.c           |  53 +-
 drivers/pci/controller/vmd.c                  |  33 +-
 drivers/pci/ide.c                             | 525 ++++++++++++
 drivers/pci/pci-sysfs.c                       |   4 +
 drivers/pci/pci.c                             |  43 +-
 drivers/pci/pci.h                             |  19 +
 drivers/pci/probe.c                           |  34 +-
 drivers/pci/remove.c                          |   3 +
 drivers/pci/tsm.c                             | 782 ++++++++++++++++++
 drivers/virt/coco/Kconfig                     |   2 +
 drivers/virt/coco/Makefile                    |   1 +
 drivers/virt/coco/host/Kconfig                |   6 +
 drivers/virt/coco/host/Makefile               |   6 +
 drivers/virt/coco/host/tsm-core.c             | 144 ++++
 include/linux/pci-ide.h                       |  76 ++
 include/linux/pci-tsm.h                       | 211 +++++
 include/linux/pci.h                           |  29 +
 include/linux/tsm.h                           |  11 +
 include/uapi/linux/pci_regs.h                 |  91 +-
 samples/Kconfig                               |  16 +
 samples/Makefile                              |   1 +
 samples/devsec/Makefile                       |  10 +
 samples/devsec/bus.c                          | 711 ++++++++++++++++
 samples/devsec/common.c                       |  26 +
 samples/devsec/devsec.h                       |  40 +
 samples/devsec/tsm.c                          | 218 +++++
 32 files changed, 3170 insertions(+), 78 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-class-tsm
 create mode 100644 Documentation/ABI/testing/sysfs-devices-pci-host-bridge
 create mode 100644 drivers/pci/ide.c
 create mode 100644 drivers/pci/tsm.c
 create mode 100644 drivers/virt/coco/host/Kconfig
 create mode 100644 drivers/virt/coco/host/Makefile
 create mode 100644 drivers/virt/coco/host/tsm-core.c
 create mode 100644 include/linux/pci-ide.h
 create mode 100644 include/linux/pci-tsm.h
 create mode 100644 samples/devsec/Makefile
 create mode 100644 samples/devsec/bus.c
 create mode 100644 samples/devsec/common.c
 create mode 100644 samples/devsec/devsec.h
 create mode 100644 samples/devsec/tsm.c


base-commit: 7515f45c165269b72ee739e6fc26cc2ef928fc1b
-- 
2.49.0


             reply	other threads:[~2025-05-16  5:47 UTC|newest]

Thread overview: 173+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16  5:47 Dan Williams [this message]
2025-05-16  5:47 ` [PATCH v3 01/13] coco/tsm: Introduce a core device for TEE Security Managers Dan Williams
2025-06-02 13:18   ` Jason Gunthorpe
2025-06-04  0:42     ` Dan Williams
2025-06-04  1:15       ` Dan Williams
2025-06-04 12:15         ` Jason Gunthorpe
2025-06-04 12:14       ` Jason Gunthorpe
2025-06-06  3:33         ` Alexey Kardashevskiy
2025-06-06  2:09     ` Alexey Kardashevskiy
2025-05-16  5:47 ` [PATCH v3 02/13] PCI/IDE: Enumerate Selective Stream IDE capabilities Dan Williams
2025-06-17 12:16   ` Jonathan Cameron
2025-07-12 22:31     ` dan.j.williams
2025-05-16  5:47 ` [PATCH v3 03/13] PCI/TSM: Authenticate devices via platform TSM Dan Williams
2025-05-21 15:32   ` Aneesh Kumar K.V
2025-06-03 19:53     ` Dan Williams
2025-06-04  8:04       ` Aneesh Kumar K.V
2025-06-17 12:51   ` Jonathan Cameron
2025-07-12 22:07     ` dan.j.williams
2025-08-26  1:31   ` Alexey Kardashevskiy
2025-08-26 23:54     ` dan.j.williams
2025-08-27  4:44       ` Alexey Kardashevskiy
2025-08-28 19:27         ` dan.j.williams
2025-08-26  3:08   ` Alexey Kardashevskiy
2025-08-26 23:58     ` dan.j.williams
2025-08-27  5:06       ` Alexey Kardashevskiy
2025-08-26 10:22   ` Alexey Kardashevskiy
2025-08-27  0:15     ` dan.j.williams
2025-08-27  5:02       ` Alexey Kardashevskiy
2025-08-28 19:32         ` dan.j.williams
2025-05-16  5:47 ` [PATCH v3 04/13] PCI: Enable host-bridge emulation for PCI_DOMAINS_GENERIC platforms Dan Williams
2025-05-16  5:47 ` [PATCH v3 05/13] PCI: vmd: Switch to pci_bus_find_emul_domain_nr() Dan Williams
2025-05-16  5:47 ` [PATCH v3 06/13] samples/devsec: Introduce a PCI device-security bus + endpoint sample Dan Williams
2025-06-17 13:30   ` Jonathan Cameron
2025-07-13  1:58     ` dan.j.williams
2025-05-16  5:47 ` [PATCH v3 07/13] PCI: Add PCIe Device 3 Extended Capability enumeration Dan Williams
2025-06-17 13:36   ` Jonathan Cameron
2025-05-16  5:47 ` [PATCH v3 08/13] PCI/IDE: Add IDE establishment helpers Dan Williams
2025-06-17 14:04   ` Jonathan Cameron
2025-07-14 18:25     ` dan.j.williams
2025-07-03  2:59   ` Alexey Kardashevskiy
2025-05-16  5:47 ` [PATCH v3 09/13] PCI/IDE: Report available IDE streams Dan Williams
2025-05-18 12:48   ` kernel test robot
2025-06-17 14:16   ` Jonathan Cameron
2025-07-14 20:16     ` dan.j.williams
2025-05-16  5:47 ` [PATCH v3 10/13] PCI/TSM: Report active " Dan Williams
2025-06-17 14:21   ` Jonathan Cameron
2025-07-14 20:49     ` dan.j.williams
2025-05-16  5:47 ` [PATCH v3 11/13] samples/devsec: Add sample IDE establishment Dan Williams
2025-06-17 14:26   ` Jonathan Cameron
2025-07-14 20:59     ` dan.j.williams
2025-05-16  5:47 ` [PATCH v3 12/13] PCI/TSM: support TDI related operations for host TSM driver Dan Williams
2025-05-16  6:52   ` Xu Yilun
2025-05-20  7:17     ` Aneesh Kumar K.V
2025-05-21  9:35       ` Xu Yilun
2025-05-26  5:05         ` Aneesh Kumar K.V
2025-05-26  7:52           ` Alexey Kardashevskiy
2025-05-26 15:44             ` Aneesh Kumar K.V
2025-05-27  1:01               ` Alexey Kardashevskiy
2025-05-27 11:48                 ` Aneesh Kumar K.V
2025-05-27 13:06                   ` Jason Gunthorpe
2025-05-27 14:26                     ` Aneesh Kumar K.V
2025-05-27 14:45                       ` Jason Gunthorpe
2025-05-28 12:17                         ` Aneesh Kumar K.V
2025-05-28 16:42                           ` Jason Gunthorpe
2025-05-28 16:52                             ` Jason Gunthorpe
2025-05-29  9:30                               ` Xu Yilun
2025-05-29 13:43                               ` Aneesh Kumar K.V
2025-05-29 14:09                                 ` Jason Gunthorpe
2025-05-30  3:00                                   ` Alexey Kardashevskiy
2025-05-30 13:21                                     ` Jason Gunthorpe
2025-05-29 13:49                             ` Xu Yilun
2025-05-29 14:05                               ` Jason Gunthorpe
2025-05-29  3:03                   ` Alexey Kardashevskiy
2025-05-29 13:34                     ` Aneesh Kumar K.V
2025-05-29 13:37                       ` [RFC PATCH 1/3] coco: tsm: Add tsm_bind/unbind helpers Aneesh Kumar K.V (Arm)
2025-05-29 13:37                         ` [RFC PATCH 2/3] iommufd/viommu: Add support to associate viommu with kvm instance Aneesh Kumar K.V (Arm)
2025-05-29 14:13                           ` Jason Gunthorpe
2025-05-29 13:37                         ` [RFC PATCH 3/3] iommufd/tsm: Add tsm_bind/unbind iommufd ioctls Aneesh Kumar K.V (Arm)
2025-05-29 14:32                           ` Jason Gunthorpe
2025-05-30  8:33                             ` Aneesh Kumar K.V
2025-05-30 18:18                               ` Jason Gunthorpe
2025-05-31 16:25                           ` Xu Yilun
2025-06-02  4:52                             ` Alexey Kardashevskiy
2025-06-02 17:17                               ` Xu Yilun
2025-06-04  1:47                                 ` Alexey Kardashevskiy
2025-06-04  5:02                                   ` Xu Yilun
2025-06-04 12:37                                   ` Jason Gunthorpe
2025-06-06 15:40                                     ` Xu Yilun
2025-06-06 16:34                                       ` Jason Gunthorpe
2025-06-09  4:47                                         ` Xu Yilun
2025-06-02 11:08                             ` Aneesh Kumar K.V
2025-06-02 16:25                               ` Xu Yilun
2025-06-02 16:48                                 ` Jason Gunthorpe
2025-06-03  4:05                                   ` Xu Yilun
2025-06-03 12:11                                     ` Jason Gunthorpe
2025-06-04  5:58                                       ` Xu Yilun
2025-06-04 12:36                                         ` Jason Gunthorpe
2025-06-05  3:05                                           ` Xu Yilun
2025-06-10  7:05                                           ` Alexey Kardashevskiy
2025-06-10 18:19                                             ` Jason Gunthorpe
2025-06-11  1:26                                               ` Alexey Kardashevskiy
2025-06-10  4:47                                     ` Alexey Kardashevskiy
2025-06-10 18:21                                       ` Jason Gunthorpe
2025-06-12  4:15                                       ` Xu Yilun
2025-06-03  5:00                                 ` Aneesh Kumar K.V
2025-06-03 10:50                                   ` Xu Yilun
2025-06-03 12:14                                     ` Jason Gunthorpe
2025-06-04  5:31                                       ` Xu Yilun
2025-06-04 12:31                                         ` Jason Gunthorpe
2025-06-05  3:25                                           ` Xu Yilun
2025-06-05 14:54                                             ` Jason Gunthorpe
2025-06-09  6:10                                               ` Xu Yilun
2025-06-09 16:42                                                 ` Suzuki K Poulose
2025-06-09 18:07                                                   ` Jason Gunthorpe
2025-06-10  7:31                                         ` Alexey Kardashevskiy
2025-06-12  5:44                                           ` Xu Yilun
2025-06-03 12:18                                   ` Jason Gunthorpe
2025-06-04  1:06                                     ` Dan Williams
2025-06-04 12:18                                       ` Jason Gunthorpe
2025-06-02 12:47                             ` Jason Gunthorpe
2025-06-03  3:47                               ` Xu Yilun
2025-06-03 12:08                                 ` Jason Gunthorpe
2025-06-04  6:39                                   ` Xu Yilun
2025-06-04 12:39                                     ` Jason Gunthorpe
2025-06-05  1:56                                       ` Xu Yilun
2025-07-15 10:29                           ` Xu Yilun
2025-07-15 13:09                             ` Jason Gunthorpe
2025-07-16 15:41                               ` Xu Yilun
2025-07-16 16:31                                 ` Jason Gunthorpe
2025-07-17  8:28                                   ` Xu Yilun
2025-07-17 12:43                                     ` Jason Gunthorpe
2025-07-18  9:15                                       ` Xu Yilun
2025-07-18 12:26                                         ` Jason Gunthorpe
2025-07-20  2:37                                           ` Xu Yilun
2025-05-30  2:44                       ` [PATCH v3 12/13] PCI/TSM: support TDI related operations for host TSM driver Alexey Kardashevskiy
2025-05-27 10:25               ` Suzuki K Poulose
2025-06-03 22:47                 ` Dan Williams
2025-06-04  1:35                   ` Alexey Kardashevskiy
2025-06-04  1:52                     ` Dan Williams
2025-06-04  1:54                       ` Dan Williams
2025-06-05 10:56                         ` Alexey Kardashevskiy
2025-06-07  1:56                           ` Dan Williams
2025-06-11  4:40                             ` Alexey Kardashevskiy
2025-06-13  3:06                               ` Dan Williams
2025-06-03 22:40             ` Dan Williams
2025-05-19 10:20   ` Alexey Kardashevskiy
2025-05-20 20:12     ` Dan Williams
2025-05-21  9:28       ` Xu Yilun
2025-05-26  8:08         ` Alexey Kardashevskiy
2025-05-29 14:20           ` Xu Yilun
2025-05-30  2:54             ` Alexey Kardashevskiy
2025-05-31 15:26               ` Xu Yilun
2025-06-02  4:51                 ` Alexey Kardashevskiy
2025-06-02 18:51                   ` Xu Yilun
2025-06-03 19:12         ` Dan Williams
2025-07-07  7:17     ` Aneesh Kumar K.V
2025-05-20  5:20   ` Aneesh Kumar K.V
2025-05-20 21:12     ` Dan Williams
2025-05-16  5:47 ` [PATCH v3 13/13] PCI/TSM: Add Guest TSM Support Dan Williams
2025-05-19 10:20   ` Alexey Kardashevskiy
2025-05-20 21:11     ` Dan Williams
2025-05-22  4:07       ` Alexey Kardashevskiy
2025-06-03 22:26         ` Dan Williams
2025-06-03 22:33           ` Jason Gunthorpe
2025-06-10  8:31           ` Alexey Kardashevskiy
2025-07-11 23:04             ` dan.j.williams
2025-05-20  9:25   ` Aneesh Kumar K.V
2025-05-20 21:27     ` Dan Williams
2025-05-20 11:00   ` Aneesh Kumar K.V
2025-05-20 21:31     ` Dan Williams
2025-06-03 19:07       ` Dan Williams
2025-05-21 15:03   ` Xu Yilun
2025-06-03 19:20     ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250516054732.2055093-1-dan.j.williams@intel.com \
    --to=dan.j.williams@intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=aik@amd.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=decui@microsoft.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jgg@nvidia.com \
    --cc=john.allen@amd.com \
    --cc=kys@microsoft.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=lukas@wunner.de \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=nirmal.patel@linux.intel.com \
    --cc=robh@kernel.org \
    --cc=sameo@rivosinc.com \
    --cc=suzuki.poulose@arm.com \
    --cc=thomas.lendacky@amd.com \
    --cc=wei.liu@kernel.org \
    --cc=xiaoyao.li@intel.com \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@linux.intel.com \
    --cc=zhiw@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).