PCI/TSM: TDX Connect: SPDM Session and IDE Establishment
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest26 patches 46 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/26 | coco/tdx-host: Introduce a "tdx_host" devicedrivers/ drivers/ drivers/ +2 more | +55 | 1 reply | |
| 2/26 | x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public headerarch/ arch/ | +4 | 0 replies | |
| 3/26 | coco/tdx-host: Support Link TSM for TDX hostarch/ drivers/ drivers/ | +160 | 1 reply | |
| 4/26 | x86/tdx: Move all TDX error defines into <asm/shared/tdx_errno.h>arch/ arch/ arch/ +1 more | +22 | 0 replies | |
| 5/26 | mm: Add __free() support for __free_page()include/ | +1 | 2 replies | |
| 6/26 | x86/virt/tdx: Add tdx_page_array helpers for new TDX Module objectsarch/ arch/ | +269 | 12 replies | |
| 7/26 | x86/virt/tdx: Read TDX global metadata for TDX Module Extensionsarch/ arch/ | +20 | 2 replies | |
| 8/26 | x86/virt/tdx: Add tdx_enable_ext() to enable of TDX Module Extensionsarch/ arch/ arch/ +1 more | +181 | 12 replies | |
| 9/26 | ACPICA: Add KEYP table definitioninclude/ | +59 | 0 replies | |
| 10/26 | acpi: Add KEYP support to fw_table parsingdrivers/ include/ include/ +1 more | +24 | 1 reply | |
| 11/26 | iommu/vt-d: Cache max domain ID to avoid redundant calculationdrivers/ drivers/ drivers/ | +7 | 2 replies | |
| 12/26 | iommu/vt-d: Reserve the MSB domain ID bit for the TDX moduledrivers/ drivers/ | +52 | 2 replies | |
| 13/26 | x86/virt/tdx: Read TDX Connect global metadata for TDX Connectarch/ arch/ | +26 | 0 replies | |
| 14/26 | mm: Add __free() support for folio_put()include/ | +2 | 2 replies | |
| 15/26 | x86/virt/tdx: Extend tdx_page_array to support IOMMU_MTarch/ arch/ | +70 | 1 reply | |
| 16/26 | x86/virt/tdx: Add a helper to loop on TDX_INTERRUPTED_RESUMABLEarch/ | +23 | 0 replies | |
| 17/26 | x86/virt/tdx: Add SEAMCALL wrappers for trusted IOMMU setup and cleararch/ arch/ arch/ | +34 | 0 replies | |
| 18/26 | iommu/vt-d: Export a helper to do function for each dmar_drhd_unitdrivers/ include/ | +18 | 0 replies | |
| 19/26 | coco/tdx-host: Setup all trusted IOMMUs on TDX Connect initdrivers/ | +85 | 0 replies | |
| 20/26 | coco/tdx-host: Add a helper to exchange SPDM messages through DOEdrivers/ | +61 | 0 replies | |
| 21/26 | x86/virt/tdx: Add SEAMCALL wrappers for SPDM managementarch/ arch/ arch/ | +130 | 0 replies | |
| 22/26 | coco/tdx-host: Implement SPDM session setuparch/ drivers/ | +299 | 0 replies | |
| 23/26 | coco/tdx-host: Parse ACPI KEYP table to init IDE for PCI host bridgesdrivers/ drivers/ | +112 | 1 reply | |
| 24/26 | x86/virt/tdx: Add SEAMCALL wrappers for IDE stream managementarch/ arch/ arch/ | +104 | 0 replies | |
| 25/26 | coco/tdx-host: Implement IDE stream setup/teardowndrivers/ drivers/ include/ | +230 | 0 replies | |
| 26/26 | coco/tdx-host: Finally enable SPDM session and IDE Establishmentdrivers/ | +3 | 2 replies |
Reviews trailers per patch
8 of 26 patches have a Reviewed-by or Acked-by.
| Patch | Jonathan Cameron |
|---|---|
| 1/26 | R-b |
| 2/26 | |
| 3/26 | R-b |
| 4/26 | |
| 5/26 | R-b |
| 6/26 | |
| 7/26 | |
| 8/26 | |
| 9/26 | |
| 10/26 | R-b |
| 11/26 | |
| 12/26 | |
| 13/26 | |
| 14/26 | R-b |
| 15/26 | |
| 16/26 | |
| 17/26 | |
| 18/26 | |
| 19/26 | |
| 20/26 | R-b |
| 21/26 | |
| 22/26 | |
| 23/26 | R-b |
| 24/26 | |
| 25/26 | |
| 26/26 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 00/26] PCI/TSM: TDX Connect: SPDM Session and IDE Establishment
This is a new version of the RFC [1]. It is based on Dan's "Link" TSM Core infrastructure [2][3] + Sean's VMXON RFC [4]. All together they enable the SPDM Session and IDE Establishment for TDX Connect. This series and its base commits are available in Dan's tsm.git#staging [5].
Changes since public RFC:
- No tdx_enable() needed in tdx-host
- Simplify tdx_page_array kAPI, no singleton mode input
- Refactor the handling of TDX_INTERRUPTED_RESUMABLE
- Refine the usage of scope-based cleanup in tdx-host
- Set nr_stream_id in tdx-host, not in PCI ACPI initialization
- Use KEYP table + ECAP bit50 to decide Domain ID reservation
- Refactor IDE Address Association Register setup
- Remove prototype patches
- Refactor tdx_enable_ext() locking because of Sean's change
- Pick ACPICA KEYP patch from ACPICA repo
- Select TDX Connect feature for TDH.SYS.CONFIG, remove temporary solution for TDH.SYS.INIT
- Use Rick's tdx_errno.h movement patch [6]
- Factor out scope-based cleanup patches in mm
- Remove redunant header files, add header files only when first used
- Use dev_err_probe() when possible
- keyp_info_match() refactor
- Use bitfield.h macros for PAGE_LIST_INFO & HPA_ARRAY_T raw value
- Remove reserved fields for spdm_config_info_t
- Simplify return for tdh_ide_stream_block()
- Other small fixes for Jonathan's comments
[1]: https://lore.kernel.org/linux-coco/[email protected]/
[2]: https://lore.kernel.org/linux-coco/[email protected]/
[3]: https://lore.kernel.org/linux-coco/[email protected]/
[4]: https://lore.kernel.org/all/[email protected]/
[5]: https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git/log/?h=staging
[6]: https://lore.kernel.org/all/[email protected]/
Trimmed Original Cover letter:
-------------------------------
Add a PCI/TSM low-level driver implemenation for TDX Connect (the TEE I/O architecture for Intel platforms). Recall that PCI/TSM 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).
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.
Chao Gao (1):
coco/tdx-host: Introduce a "tdx_host" device
Dave Jiang (2):
ACPICA: Add KEYP table definition
acpi: Add KEYP support to fw_table parsing
Kirill A. Shutemov (1):
x86/tdx: Move all TDX error defines into <asm/shared/tdx_errno.h>
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 (15):
x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public header coco/tdx-host: Support Link TSM for TDX host
mm: Add __free() support for __free_page()
x86/virt/tdx: Add tdx_page_array helpers for new TDX Module objects x86/virt/tdx: Read TDX global metadata for TDX Module Extensions x86/virt/tdx: Read TDX Connect global metadata for TDX Connect
mm: Add __free() support for folio_put()
x86/virt/tdx: Extend tdx_page_array to support IOMMU_MT x86/virt/tdx: Add a helper to loop on TDX_INTERRUPTED_RESUMABLE 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: Parse ACPI KEYP table to init IDE for PCI host bridges x86/virt/tdx: Add SEAMCALL wrappers for IDE stream management coco/tdx-host: Implement IDE stream setup/teardown coco/tdx-host: Finally enable SPDM session and IDE Establishment
Zhenzhong Duan (5):
x86/virt/tdx: Add tdx_enable_ext() to enable of TDX Module Extensions 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
drivers/virt/coco/Kconfig | 2 +
drivers/virt/coco/tdx-host/Kconfig | 17 +
drivers/virt/coco/Makefile | 1 +
drivers/virt/coco/tdx-host/Makefile | 1 +
arch/x86/include/asm/shared/tdx.h | 1 +
.../vmx => include/asm/shared}/tdx_errno.h | 29 +-
arch/x86/include/asm/tdx.h | 76 +-
arch/x86/include/asm/tdx_global_metadata.h | 14 +
arch/x86/kvm/vmx/tdx.h | 1 -
arch/x86/virt/vmx/tdx/tdx.h | 16 +-
drivers/iommu/intel/iommu.h | 2 +
include/acpi/actbl2.h | 59 ++
include/linux/acpi.h | 3 +
include/linux/dmar.h | 2 +
include/linux/fw_table.h | 1 +
include/linux/gfp.h | 1 +
include/linux/mm.h | 2 +
include/linux/pci-ide.h | 2 +
arch/x86/virt/vmx/tdx/tdx.c | 740 ++++++++++++-
arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 32 +
drivers/acpi/tables.c | 12 +-
drivers/iommu/intel/dmar.c | 67 ++
drivers/iommu/intel/iommu.c | 10 +-
drivers/pci/ide.c | 5 +-
drivers/virt/coco/tdx-host/tdx-host.c | 969 ++++++++++++++++++
lib/fw_table.c | 9 +
26 files changed, 2027 insertions(+), 47 deletions(-)
create mode 100644 drivers/virt/coco/tdx-host/Kconfig
create mode 100644 drivers/virt/coco/tdx-host/Makefile
rename arch/x86/{kvm/vmx => include/asm/shared}/tdx_errno.h (62%)
create mode 100644 drivers/virt/coco/tdx-host/tdx-host.cSignature · 1 line
2.25.1