RFC PCI/TSM: TDX Connect: SPDM Session and IDE Establishment
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest27 patches 31 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/27 | coco/tdx-host: Introduce a "tdx_host" devicedrivers/ drivers/ drivers/ +2 more | +66 | 2 replies | |
| 2/27 | x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public headerarch/ arch/ | +4 | 0 replies | |
| 3/27 | coco/tdx-host: Support Link TSM for TDX hostarch/ drivers/ drivers/ | +151 | 2 replies | |
| 4/27 | x86/virt/tdx: Move tdx_errno.h from KVM to public placearch/ arch/ arch/ | +4 | 1 reply | |
| 5/27 | x86/virt/tdx: Add tdx_page_array helpers for new TDX Module objectsarch/ arch/ include/ | +241 | 2 replies | |
| 6/27 | x86/virt/tdx: Add SEAMCALL wrappers for TDH.EXT.MEM.ADD and TDH.EXT.INITarch/ arch/ arch/ | +53 | 0 replies | |
| 7/27 | TODO: x86/virt/tdx: Read TDX global metadata for TDX Module Extensionsarch/ arch/ | +20 | 0 replies | |
| 8/27 | x86/virt/tdx: Add tdx_enable_ext() to enable of TDX Module Extensionsarch/ arch/ arch/ +1 more | +155 | 2 replies | |
| 9/27 | ACPICA: Add KEYP table definitionsinclude/ | +60 | 2 replies | |
| 10/27 | acpi: Add KEYP support to fw_table parsingdrivers/ drivers/ include/ +2 more | +48 | 0 replies | |
| 11/27 | acpi: Add KEYP Key Configuration Unit parsingdrivers/ drivers/ drivers/ +2 more | +126 | 2 replies | |
| 12/27 | iommu/vt-d: Cache max domain ID to avoid redundant calculationdrivers/ drivers/ drivers/ | +7 | 0 replies | |
| 13/27 | iommu/vt-d: Reserve the MSB domain ID bit for the TDX moduledrivers/ | +28 | 0 replies | |
| 14/27 | TODO: x86/virt/tdx: Read TDX Connect global metadata for TDX Connectarch/ arch/ | +26 | 0 replies | |
| 15/27 | x86/virt/tdx: Extend tdx_page_array to support IOMMU_MTarch/ arch/ include/ | +77 | 1 reply | |
| 16/27 | x86/virt/tdx: Add SEAMCALL wrappers for trusted IOMMU setup and cleararch/ arch/ arch/ | +32 | 0 replies | |
| 17/27 | iommu/vt-d: Export a helper to do function for each dmar_drhd_unitdrivers/ include/ | +18 | 0 replies | |
| 18/27 | coco/tdx-host: Setup all trusted IOMMUs on TDX Connect initdrivers/ | +90 | 1 reply | |
| 19/27 | coco/tdx-host: Add a helper to exchange SPDM messages through DOEdrivers/ | +61 | 1 reply | |
| 20/27 | coco/tdx-host: Add connect()/disconnect() handlers prototypedrivers/ | +48 | 8 replies | |
| 21/27 | x86/virt/tdx: Add SEAMCALL wrappers for SPDM managementarch/ arch/ arch/ | +149 | 2 replies | |
| 22/27 | coco/tdx-host: Implement SPDM session setuparch/ drivers/ | +276 | 2 replies | |
| 23/27 | PCI: iov: Export pci_iov_virtfn_bus()drivers/ | +1 | 0 replies | |
| 24/27 | PCI/IDE: Add helpers for RID/Addr Association Registers setupinclude/ | +14 | 0 replies | |
| 25/27 | PCI/IDE: Export pci_ide_domain()drivers/ include/ | +3 | 0 replies | |
| 26/27 | x86/virt/tdx: Add SEAMCALL wrappers for IDE stream managementarch/ arch/ arch/ | +109 | 1 reply | |
| 27/27 | coco/tdx-host: Implement IDE stream setup/teardowndrivers/ | +270 | 2 replies |
Reviews trailers per patch
2 of 27 patches have a Reviewed-by or Acked-by.
| Patch | Jonathan Cameron | Dan Williams |
|---|---|---|
| 1/27 | ||
| 2/27 | ||
| 3/27 | ||
| 4/27 | ||
| 5/27 | ||
| 6/27 | ||
| 7/27 | ||
| 8/27 | ||
| 9/27 | ||
| 10/27 | ||
| 11/27 | ||
| 12/27 | ||
| 13/27 | ||
| 14/27 | ||
| 15/27 | ||
| 16/27 | ||
| 17/27 | ||
| 18/27 | ||
| 19/27 | R-b | |
| 20/27 | A-b | |
| 21/27 | ||
| 22/27 | ||
| 23/27 | ||
| 24/27 | ||
| 25/27 | ||
| 26/27 | ||
| 27/27 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH 00/27] PCI/TSM: TDX Connect: SPDM Session and IDE Establishment
Add a PCI/TSM low-level driver implemenation for TDX Connect (the TEE I/O architecture for Intel platforms). Recall that PCI/TSM [1] is the Linux PCI core subsystem for interfacing with platform Trusted Execution Environment (TEE) Security Managers (TSMs). TSMs establish secure sessions with PCIe devices (SPDM over Data Object Exchange (DOE) mailboxes) and establish PCIe link Integrity and Data Encryption (IDE).
The motivation for sending this out as an RFC with open TODOs beyond "release early, release often" is:
- Get out of the phase of PCI/TSM core updates being done with only samples/devsec/ testing, i.e. avoid regressions like [2]
- Enable better collaboration on follow on common infrastructure like address association setup
- Take another step closer to the "at least two vendor implementations in #staging" threshold in a potential first intercept of v6.19.
This SPDM and IDE facility is enabled with TDX via a new capability called a TDX Module Extension. An extension, as might be expected, is a family of new seamcalls. Unlike typical base module seamcalls, an extension supports preemptible calls for long running flows like SPDM session establishment. This extension capability was added in response to Intel Linux team feedback and in support of reducing the complexity of the Linux implementation. The result is sequences like the following:
guard(mutex)(&tdx_ext_lock);
do {
r = tdh_spdm_connect(tlink->spdm_id, tlink->spdm_conf,
tlink->in_msg, tlink->out_msg,
dev_info, &out_msg_sz);
ret = tdx_link_event_handler(tlink, r, out_msg_sz);
} while (ret == -EAGAIN);...where tdh_spdm_connect() is a seamcall that may return early if this CPU takes a hardirq or if the module needs a DOE message marshalled to the device. tdx_link_event_handler() marshals the message and the extension is resumed to continue the flow. In this case the TDX Connect extension supports 1 caller at a time, think of it like a queue-depth of one device-firmware command queue, so concurrency is managed with @tdx_ext_lock.
This series and its base commit are available in tsm.git#tdx [3]. The base commit includes devsec-20250911 and two in progress proposals, "always enable VMX", and "refactor TDX CPU enabling into tdx_enable()". I am holding off on putting this series in #staging because that VMX work also includes an untested proposed cleanup to AMD SVM. If someone has cycles to test this commit on AMD it would be greatly appreciated:
9d5a519d61d3 x86/boot, KVM: SVM: Move enabling/disabling SVM to CPU startup/shutdown phase
Not posting those proposals for now to focus on the PCI/TSM aspects of this and save the deeper KVM implications of "TDX Host Services", for a later time.
[1]: PCI/TSM: Core infrastructure for PCI device security (TDISP)
http://lore.kernel.org/[email protected]
[2]: http://lore.kernel.org/[email protected]
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git/log/?h=tdx
Chao Gao (1):
coco/tdx-host: Introduce a "tdx_host" device
Dave Jiang (3):
ACPICA: Add KEYP table definitions
acpi: Add KEYP support to fw_table parsing
acpi: Add KEYP Key Configuration Unit parsing
Lu Baolu (2):
iommu/vt-d: Cache max domain ID to avoid redundant calculation iommu/vt-d: Reserve the MSB domain ID bit for the TDX module
Xu Yilun (16):
x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public header coco/tdx-host: Support Link TSM for TDX host
x86/virt/tdx: Move tdx_errno.h from KVM to public place x86/virt/tdx: Add tdx_page_array helpers for new TDX Module objects
TODO: x86/virt/tdx: Read TDX global metadata for TDX Module Extensions x86/virt/tdx: Add tdx_enable_ext() to enable of TDX Module Extensions
TODO: x86/virt/tdx: Read TDX Connect global metadata for TDX Connect x86/virt/tdx: Extend tdx_page_array to support IOMMU_MT iommu/vt-d: Export a helper to do function for each dmar_drhd_unit coco/tdx-host: Setup all trusted IOMMUs on TDX Connect init coco/tdx-host: Add connect()/disconnect() handlers prototype
PCI: iov: Export pci_iov_virtfn_bus()
PCI/IDE: Add helpers for RID/Addr Association Registers setup PCI/IDE: Export pci_ide_domain()
x86/virt/tdx: Add SEAMCALL wrappers for IDE stream management coco/tdx-host: Implement IDE stream setup/teardown
Zhenzhong Duan (5):
x86/virt/tdx: Add SEAMCALL wrappers for TDH.EXT.MEM.ADD and
TDH.EXT.INIT
x86/virt/tdx: Add SEAMCALL wrappers for trusted IOMMU setup and clear coco/tdx-host: Add a helper to exchange SPDM messages through DOE x86/virt/tdx: Add SEAMCALL wrappers for SPDM management coco/tdx-host: Implement SPDM session setup
arch/x86/include/asm/tdx.h | 58 ++
arch/x86/{kvm/vmx => include/asm}/tdx_errno.h | 8 +-
arch/x86/include/asm/tdx_global_metadata.h | 14 +
arch/x86/kvm/vmx/tdx.h | 1 -
arch/x86/virt/vmx/tdx/tdx.c | 731 +++++++++++++-
arch/x86/virt/vmx/tdx/tdx.h | 17 +-
arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 32 +
drivers/acpi/Kconfig | 12 +
drivers/acpi/Makefile | 2 +
drivers/acpi/pci_root.c | 2 +
drivers/acpi/tables.c | 14 +-
drivers/acpi/x86/keyp.c | 118 +++
drivers/iommu/intel/dmar.c | 44 +
drivers/iommu/intel/iommu.c | 10 +-
drivers/iommu/intel/iommu.h | 1 +
drivers/pci/ide.c | 3 +-
drivers/pci/iov.c | 1 +
drivers/virt/coco/Kconfig | 2 +
drivers/virt/coco/Makefile | 1 +
drivers/virt/coco/tdx-host/Kconfig | 17 +
drivers/virt/coco/tdx-host/Makefile | 1 +
drivers/virt/coco/tdx-host/tdx-host.c | 942 ++++++++++++++++++
include/acpi/actbl3.h | 60 ++
include/linux/acpi.h | 16 +
include/linux/dmar.h | 2 +
include/linux/fw_table.h | 1 +
include/linux/gfp.h | 2 +
include/linux/mm.h | 2 +
include/linux/pci-ide.h | 15 +
lib/fw_table.c | 9 +
30 files changed, 2121 insertions(+), 17 deletions(-)
rename arch/x86/{kvm/vmx => include/asm}/tdx_errno.h (87%)
create mode 100644 drivers/acpi/x86/keyp.c
create mode 100644 drivers/virt/coco/tdx-host/Kconfig
create mode 100644 drivers/virt/coco/tdx-host/Makefile
create mode 100644 drivers/virt/coco/tdx-host/tdx-host.cbase-commit: 0d1fbc1f1b7a3c8b14a643303dd89bcc82d3fbd0
Signature · 1 line
2.51.0