RFC PCI/TSM: Add CTLV attestation
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest11 patches 117 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | attestation: Restrict inherited operations per instanceDocumentation/ Documentation/ Documentation/ +10 more | +237 | 1 reply | |
| 2/11 | attestation: Filter evidence objects per instancedrivers/ drivers/ include/ | +21 | 3 replies | |
| 3/11 | attestation: Enter secure operation when evidence is acceptedDocumentation/ Documentation/ drivers/ +12 more | +51 | 4 replies | |
| 4/11 | attestation: Bind object selection to accepted evidence snapshotsDocumentation/ Documentation/ drivers/ +12 more | +314 | 0 replies | |
| 5/11 | attestation: Make the evidence-get challenge attribute optionalDocumentation/ Documentation/ Documentation/ +8 more | +69 | 0 replies | |
| 6/11 | PCI/TSM: Describe the PCI attestation control familyDocumentation/ Documentation/ Documentation/ +12 more | +2392 | 12 replies | |
| 7/11 | attestation: Add attestation helpers for PCI/TSM integrationdrivers/ include/ | +84 | 0 replies | |
| 8/11 | PCI/TSM: Bind CTLV attestation to connected and locked contextsDocumentation/ Documentation/ Documentation/ +18 more | +1075 | 8 replies | |
| 9/11 | crypto/ccp: Defer SEV-TIO link setup until evidence acceptancedrivers/ drivers/ drivers/ | +176 | 5 replies | |
| 10/11 | virt: coco: arm-cca-host: Publish slot zero and establish streams after acceptanceDocumentation/ Documentation/ Documentation/ +6 more | +222 | 82 replies | |
| 11/11 | virt: coco: arm-cca-guest: Refresh selected evidence against trusted digestsdrivers/ | +83 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH v1 00/11] PCI/TSM: Add CTLV attestation
This series connects PCI/TSM to the common CTLV attestation interface. Userspace can discover a device's evidence objects, retrieve them, and accept the evidence before the kernel establishes a secure link or moves a guest device into TDISP RUN. It replaces the PCI/TSM netlink evidence interface while retaining connect, disconnect, lock and unlock in sysfs.
This series builds on the CTLV attestation series [1] and Arm CCA device-assignment support. It covers PCI/TSM attestation through certificate slot-zero.
The development tree is available at:
https://gitlab.arm.com/linux-arm/linux-cca.git cca/topics/cca-da-attestation
That branch also includes the follow-up Rust SPDM certificate-slot discovery work, generic attestation fixes, and CTLV tooling fixes.
[1] https://lore.kernel.org/all/[email protected]
The host flow separates identity collection from session and IDE setup:
sysfs connect
-> collect and cache the certificate chain
DEVICE_GET / EVIDENCE_GET
-> discover available objects and retrieve the chain for verification
EVIDENCE_ACCEPT
-> establish the secure session and IDE streams
sysfs disconnect
-> release the identity context and any established streamsBoth AMD SEV-TIO and Arm CCA host drivers implement this flow using their existing firmware interfaces. AMD pauses the firmware SPDM exchange after collecting the certificate chain, before sending authentication or session establishment requests. CCA creates the PDEV and collects its certificate chain during connect, then completes session and stream setup on acceptance. After both conversions, every link driver must supply an evidence_accept callback; connect collects identity evidence without establishing streams.
This is the slot-zero baseline: the AMD and CCA host drivers expose their slot-zero certificate chains. A follow-up series adds shared SPDM identity discovery and selection among discovered certificate slots. The common interface supports any certificate slot advertised by the driver, and the same evidence-get and evidence-accept commands apply to both series.
For a guest device, sysfs lock collects the initial evidence and creates the CTLV instance. Userspace can optionally refresh supported objects, retrieve the cached evidence, verify it, and issue EVIDENCE_ACCEPT to enter RUN. The CCA guest driver supports refreshing measurements with a 32-byte challenge or an interface report without a challenge. It checks the new bytes against trusted digests and device state before replacing the selected cached object. Refresh is disabled after the device enters RUN.
EVIDENCE_GET reads the cached snapshot, so its challenge attribute becomes optional. EVIDENCE_REFRESH requests new evidence and invalidates previous evidence generations and acceptance. A failed backend refresh also invalidates them and requires recovery.
EVIDENCE_ACCEPT replaces the separate DEVSEC_RUN operation. Clearing acceptance leaves the hardware state unchanged: a guest device can remain in RUN, and host IDE streams remain established. DEVSEC_STATE_GET therefore continues to report acceptance and device state separately. Disconnect and unlock perform teardown.
The common attestation changes let each instance expose the operations and evidence objects its device supports. This allows host links and guest devices to share the PCI attestation implementation while advertising different capabilities. Additional locking and generation helpers let PCI/TSM coordinate state changes, evidence invalidation and notifications with CTLV operations.
The PCI child family adds STATE_GET and EVIDENCE_REFRESH to the inherited attestation operations. An instance appears only after a successful connect or lock and is removed on disconnect or unlock. DEVICE_GET includes the PCI name so userspace can associate an instance with its device.
The first five patches prepare the common attestation interface. The next three define and implement the PCI integration, including its locking helpers. The final three convert AMD and CCA host link setup and add CCA guest evidence refresh. The series builds on the existing CTLV attestation and PCI/TSM device-assignment support.
Notes:
* I used Codex to help implement, review and organize the series.
Aneesh Kumar K.V (Arm) (11):
attestation: Restrict inherited operations per instance
attestation: Filter evidence objects per instance
attestation: Enter secure operation when evidence is accepted
attestation: Bind object selection to accepted evidence snapshots
attestation: Make the evidence-get challenge attribute optional PCI/TSM: Describe the PCI attestation control family
attestation: Add attestation helpers for PCI/TSM integration PCI/TSM: Bind CTLV attestation to connected and locked contexts crypto/ccp: Defer SEV-TIO link setup until evidence acceptance
virt: coco: arm-cca-host: Publish slot zero and establish streams
after acceptance
virt: coco: arm-cca-guest: Refresh selected evidence against trusted
digests
Documentation/ABI/testing/sysfs-bus-pci | 108 +- Documentation/ABI/testing/sysfs-class-tsm | 9 +- .../ctlv/abi/ctlv-attestation-pci.yaml | 43 + Documentation/ctlv/abi/ctlv-attestation.yaml | 59 +- Documentation/ctlv/abi/families.registry.yaml | 1 + Documentation/ctlv/families.yaml | 1 + Documentation/ctlv/generated-files.yaml | 11 + .../ctlv/specs/ctlv-attestation-pci.yaml | 79 + .../ctlv/specs/ctlv-attestation.yaml | 40 +- Documentation/driver-api/attestation.rst | 56 + Documentation/driver-api/pci/tsm.rst | 160 +- Documentation/netlink/specs/pci-tsm.yaml | 151 -- drivers/attestation/core/core.c | 123 +- drivers/attestation/core/ctlv.c | 156 +- drivers/attestation/core/internal.h | 3 + .../generated/ctlv_attestation_gen.c | 45 +- .../generated/ctlv_attestation_gen.h | 76 +- drivers/attestation/providers/sim.c | 40 +- drivers/attestation/tests/core_kunit.c | 72 +- drivers/crypto/ccp/sev-dev-tio.c | 17 +- drivers/crypto/ccp/sev-dev-tio.h | 5 + drivers/crypto/ccp/sev-dev-tsm.c | 188 +- drivers/pci/Kconfig | 3 + drivers/pci/tsm/Makefile | 6 +- drivers/pci/tsm/attestation.c | 525 +++++ drivers/pci/tsm/core.c | 431 +++-- drivers/pci/tsm/ctlv_attestation_pci_gen.c | 111 ++ drivers/pci/tsm/ctlv_attestation_pci_gen.h | 100 + drivers/pci/tsm/evidence.c | 274 --- drivers/pci/tsm/internal.h | 26 + drivers/pci/tsm/netlink.c | 43 - drivers/pci/tsm/netlink.h | 23 - drivers/virt/coco/arm-cca-guest/main.c | 168 +- drivers/virt/coco/arm-cca-guest/rsi-da.c | 16 +- drivers/virt/coco/arm-cca-host/main.c | 143 +- drivers/virt/coco/arm-cca-host/rmi-da.c | 7 +- drivers/virt/coco/arm-cca-host/rmi-da.h | 2 + include/linux/attestation.h | 93 +- include/linux/pci-tsm.h | 86 +- include/linux/pci.h | 2 + include/uapi/linux/ctlv_attestation_gen.h | 25 +- include/uapi/linux/ctlv_attestation_pci_gen.h | 74 + include/uapi/linux/ctlv_families_gen.h | 1 + include/uapi/linux/pci-tsm-netlink.h | 101 - samples/devsec/common.c | 1 - samples/devsec/link_tsm.c | 17 +- samples/devsec/tsm.c | 32 +- tools/ctlv/tests/support.py | 3 +- tools/ctlv/tests/test_outputs.py | 6 +- tools/ctlv/tests/test_semantics.py | 38 + tools/ctlv/tests/test_spec.py | 1 + .../selftests/attestation/attestation_test.c | 32 +- .../ctlv_attestation_pci_user_gen.c | 1697 +++++++++++++++++ .../ctlv_attestation_pci_user_gen.h | 230 +++ .../ctlv_attestation_sim_user_gen.c | 161 +- .../ctlv_attestation_tdx_user_gen.c | 161 +- .../attestation/ctlv_attestation_user_gen.c | 161 +- .../attestation/ctlv_attestation_user_gen.h | 70 +- .../attestation/tdx_attestation_test.c | 9 +- 59 files changed, 4678 insertions(+), 1644 deletions(-) create mode 100644 Documentation/ctlv/abi/ctlv-attestation-pci.yaml create mode 100644 Documentation/ctlv/specs/ctlv-attestation-pci.yaml delete mode 100644 Documentation/netlink/specs/pci-tsm.yaml create mode 100644 drivers/pci/tsm/attestation.c create mode 100644 drivers/pci/tsm/ctlv_attestation_pci_gen.c create mode 100644 drivers/pci/tsm/ctlv_attestation_pci_gen.h delete mode 100644 drivers/pci/tsm/evidence.c create mode 100644 drivers/pci/tsm/internal.h delete mode 100644 drivers/pci/tsm/netlink.c delete mode 100644 drivers/pci/tsm/netlink.h create mode 100644 include/uapi/linux/ctlv_attestation_pci_gen.h delete mode 100644 include/uapi/linux/pci-tsm-netlink.h create mode 100644 tools/testing/selftests/attestation/ctlv_attestation_pci_user_gen.c create mode 100644 tools/testing/selftests/attestation/ctlv_attestation_pci_user_gen.h
Signature · 1 line
2.43.0