linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH kernel 0/6] PCI/TSM: Enabling core infrastructure on AMD SEV TIO
@ 2025-11-11  6:38 Alexey Kardashevskiy
  2025-11-11  6:38 ` [PATCH kernel 1/6] PCI/TSM: Add secure SPDM DOE mailbox Alexey Kardashevskiy
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Alexey Kardashevskiy @ 2025-11-11  6:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-crypto, linux-pci, Tom Lendacky, John Allen, Herbert Xu,
	David S. Miller, Ashish Kalra, Joerg Roedel,
	Suravee Suthikulpanit, Will Deacon, Robin Murphy, Dan Williams,
	Bjorn Helgaas, Eric Biggers, Brijesh Singh, Gary R Hook,
	Borislav Petkov (AMD), Kim Phillips, Vasant Hegde,
	Jason Gunthorpe, Michael Roth, Jonathan Cameron, Xu Yilun,
	Gao Shiyuan, Sean Christopherson, Nikunj A Dadhania, Dionna Glaze,
	iommu, linux-coco, Alexey Kardashevskiy

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 previous conversation is here:
https://lore.kernel.org/r/20250218111017.491719-1-aik@amd.com

This is based on sha1
6fdb0d839738 Dan Williams "PCI/TSM: Documentation: Add Maturity Map".

Please comment. Thanks.



Alexey Kardashevskiy (6):
  PCI/TSM: Add secure SPDM DOE mailbox
  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: Enable SEV-TIO feature in the PSP when supported
  crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)

 drivers/crypto/ccp/Kconfig          |   1 +
 drivers/crypto/ccp/Makefile         |   8 +
 drivers/crypto/ccp/sev-dev-tio.h    | 141 +++
 drivers/crypto/ccp/sev-dev.h        |   8 +
 drivers/iommu/amd/amd_iommu_types.h |   1 +
 include/linux/amd-iommu.h           |   2 +
 include/linux/pci-tsm.h             |  14 +
 include/linux/psp-sev.h             |  22 +-
 include/uapi/linux/psp-sev.h        |  66 +-
 drivers/crypto/ccp/sev-dev-tio.c    | 989 ++++++++++++++++++++
 drivers/crypto/ccp/sev-dev-tsm.c    | 435 +++++++++
 drivers/crypto/ccp/sev-dev.c        |  69 +-
 drivers/iommu/amd/init.c            |   9 +
 drivers/pci/tsm.c                   |   4 +
 14 files changed, 1733 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

-- 
2.51.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-11-21  1:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11  6:38 [PATCH kernel 0/6] PCI/TSM: Enabling core infrastructure on AMD SEV TIO Alexey Kardashevskiy
2025-11-11  6:38 ` [PATCH kernel 1/6] PCI/TSM: Add secure SPDM DOE mailbox Alexey Kardashevskiy
2025-11-14  1:51   ` dan.j.williams
2025-11-17  1:49     ` Alexey Kardashevskiy
2025-11-11  6:38 ` [PATCH kernel 2/6] ccp: Make snp_reclaim_pages and __sev_do_cmd_locked public Alexey Kardashevskiy
2025-11-11  6:38 ` [PATCH kernel 3/6] psp-sev: Assign numbers to all status codes and add new Alexey Kardashevskiy
2025-11-11  6:38 ` [PATCH kernel 4/6] iommu/amd: Report SEV-TIO support Alexey Kardashevskiy
2025-11-11  6:38 ` [PATCH kernel 5/6] crypto: ccp: Enable SEV-TIO feature in the PSP when supported Alexey Kardashevskiy
2025-11-11  6:38 ` [PATCH kernel 6/6] crypto/ccp: Implement SEV-TIO PCIe IDE (phase1) Alexey Kardashevskiy
2025-11-11 11:47   ` Jonathan Cameron
2025-11-12  2:05     ` Alexey Kardashevskiy
2025-11-17  1:32     ` Alexey Kardashevskiy
2025-11-20 21:28       ` dan.j.williams
2025-11-21  1:40         ` Alexey Kardashevskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).