Skip to content

RFC PCI/TSM: Add CTLV attestation

Aneesh Kumar K.V (Arm) linux-coco linux-patches 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 117 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11attestation: Restrict inherited operations per instanceDocumentation/ctlv/abi/ctlv-attestation.yaml Documentation/ctlv/specs/ctlv-attestation.yaml Documentation/driver-api/attestation.rst +10 more+237 -231 reply
2/11attestation: Filter evidence objects per instancedrivers/attestation/core/core.c drivers/attestation/core/ctlv.c include/linux/attestation.h+21 -43 replies
3/11attestation: Enter secure operation when evidence is acceptedDocumentation/ctlv/abi/ctlv-attestation.yaml Documentation/ctlv/specs/ctlv-attestation.yaml drivers/attestation/core/core.c +12 more+51 -5334 replies
4/11attestation: Bind object selection to accepted evidence snapshotsDocumentation/ctlv/abi/ctlv-attestation.yaml Documentation/ctlv/specs/ctlv-attestation.yaml drivers/attestation/core/core.c +12 more+314 -240 replies
5/11attestation: Make the evidence-get challenge attribute optionalDocumentation/ctlv/abi/ctlv-attestation.yaml Documentation/ctlv/specs/ctlv-attestation.yaml Documentation/driver-api/attestation.rst +8 more+69 -530 replies
6/11PCI/TSM: Describe the PCI attestation control familyDocumentation/ctlv/abi/ctlv-attestation-pci.yaml Documentation/ctlv/abi/families.registry.yaml Documentation/ctlv/families.yaml +12 more+2392 -412 replies
7/11attestation: Add attestation helpers for PCI/TSM integrationdrivers/attestation/core/core.c include/linux/attestation.h+84 -30 replies
8/11PCI/TSM: Bind CTLV attestation to connected and locked contextsDocumentation/ABI/testing/sysfs-bus-pci Documentation/ABI/testing/sysfs-class-tsm Documentation/driver-api/pci/tsm.rst +18 more+1075 -9018 replies
9/11crypto/ccp: Defer SEV-TIO link setup until evidence acceptancedrivers/crypto/ccp/sev-dev-tio.c drivers/crypto/ccp/sev-dev-tio.h drivers/crypto/ccp/sev-dev-tsm.c+176 -355 replies
10/11virt: coco: arm-cca-host: Publish slot zero and establish streams after acceptanceDocumentation/ABI/testing/sysfs-bus-pci Documentation/driver-api/attestation.rst Documentation/driver-api/pci/tsm.rst +6 more+222 -5982 replies
11/11virt: coco: arm-cca-guest: Refresh selected evidence against trusted digestsdrivers/virt/coco/arm-cca-guest/main.c+83 -510 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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 streams

Both 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.

Cc Jiri Pirko <[email protected]>
Cc Kevin Tian <[email protected]>
Cc Alexey Kardashevskiy <[email protected]>
Cc Xu Yilun <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Steven Price <[email protected]>
Cc Kiryl Shutsemau <[email protected]>
Cc Rick Edgecombe <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Bjorn Helgaas <[email protected]>
Cc Ashish Kalra <[email protected]>
Cc Tom Lendacky <[email protected]>
Cc John Allen <[email protected]>
Cc Will Deacon <[email protected]>
Cc Mark Rutland <[email protected]>

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