Skip to content

PCI/TSM: Enabling core infrastructure on AMD SEV TIO

Alexey Kardashevskiy linux-coco linux-crypto linux-iommu lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 6 repliesIn review
  2. v25 patches 11 repliesSuperseded
  3. v16 patches 7 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ccp: Make snp_reclaim_pages and __sev_do_cmd_locked publicdrivers/crypto/ccp/sev-dev.c drivers/crypto/ccp/sev-dev.h include/linux/psp-sev.h+11 -80 replies
2/4psp-sev: Assign numbers to all status codes and add newinclude/uapi/linux/psp-sev.h+41 -250 replies
3/4iommu/amd: Report SEV-TIO supportdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c include/linux/amd-iommu.h+12 -01 reply
4/4crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)drivers/crypto/ccp/Kconfig drivers/crypto/ccp/Makefile drivers/crypto/ccp/sev-dev-tio.c +5 more+1465 -35 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchJoerg RoedelVasant HegdeTom LendackyAlexey Kardashevskiy
1/4
2/4
3/4A-b R-b
4/4A-b A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH kernel v3 0/4] PCI/TSM: Enabling core infrastructure on AMD SEV TIO

Here are some patches to begin enabling SEV-TIO on AMD.

SEV-TIO allows guests to establish trust in a device that supports TEE Device Interface Security Protocol (TDISP, defined in PCIe r6.0+) and then interact with the device via private memory.

In order to streamline upstreaming process, a common TSM infrastructure is being developed in collaboration with Intel+ARM+RiscV. There is Documentation/driver-api/pci/tsm.rst with proposed phases:
1. IDE: encrypt PCI, host only
2. TDISP: lock + accept flow, host and guest, interface report
3. Enable secure MMIO + DMA: IOMMUFD, KVM changes
4. Device attestation: certificates, measurements

This is phase1 == IDE only.

SEV TIO spec:
https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/specifications/58271.pdf

Acronyms:
TEE - Trusted Execution Environments, a concept of managing trust between the host and devices
TSM - TEE Security Manager (TSM), an entity which ensures security on the host
PSP - AMD platform secure processor (also "ASP", "AMD-SP"), acts as TSM on AMD.
SEV TIO - the TIO protocol implemented by the PSP and used by the host GHCB - guest/host communication block - a protocol for guest-to-host communication via a shared page
TDISP - TEE Device Interface Security Protocol (PCIe).

Flow:
- Boot host OS, load CCP which registers itself as a TSM
- PCI TSM creates sysfs nodes under "tsm" subdirectory in for all TDISP-capable devices
- Enable IDE via "echo tsm0 > /sys/bus/pci/devices/0000:e1:00.0/tsm/connect"
- observe "secure" in stream states in "lspci" for the rootport and endpoint

This is pushed out to
https://github.com/AMDESE/linux-kvm/commits/tsm-staging

The full "WIP" trees and configs are here:
https://github.com/AMDESE/AMDSEV/blob/tsm/stable-commits

The previous conversation is here:
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]
https://lore.kernel.org/r/[email protected]

This is based on sha1
f7ae6d4ec652 Dan Williams "PCI/TSM: Add 'dsm' and 'bound' attributes for dependent functions".

Please comment. Thanks.

Alexey Kardashevskiy (4):
ccp: Make snp_reclaim_pages and __sev_do_cmd_locked public
psp-sev: Assign numbers to all status codes and add new iommu/amd: Report SEV-TIO support
crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)

 drivers/crypto/ccp/Kconfig          |   1 +
 drivers/crypto/ccp/Makefile         |   4 +
 drivers/crypto/ccp/sev-dev-tio.h    | 123 +++
 drivers/crypto/ccp/sev-dev.h        |  11 +
 drivers/iommu/amd/amd_iommu_types.h |   1 +
 include/linux/amd-iommu.h           |   2 +
 include/linux/psp-sev.h             |  17 +-
 include/uapi/linux/psp-sev.h        |  66 +-
 drivers/crypto/ccp/sev-dev-tio.c    | 864 ++++++++++++++++++++
 drivers/crypto/ccp/sev-dev-tsm.c    | 405 +++++++++
 drivers/crypto/ccp/sev-dev.c        |  62 +-
 drivers/iommu/amd/init.c            |   9 +
 12 files changed, 1529 insertions(+), 36 deletions(-)
 create mode 100644 drivers/crypto/ccp/sev-dev-tio.h
 create mode 100644 drivers/crypto/ccp/sev-dev-tio.c
 create mode 100644 drivers/crypto/ccp/sev-dev-tsm.c
Signature · 1 line
2.51.1