linux-kernelorg-stable/Documentation/driver-api
Dan Williams 3225f52cde PCI/TSM: Establish Secure Sessions and Link Encryption
The PCIe 7.0 specification, section 11, defines the Trusted Execution
Environment (TEE) Device Interface Security Protocol (TDISP).  This
protocol definition builds upon Component Measurement and Authentication
(CMA), and link Integrity and Data Encryption (IDE). It adds support for
assigning devices (PCI physical or virtual function) to a confidential VM
such that the assigned device is enabled to access guest private memory
protected by technologies like Intel TDX, AMD SEV-SNP, RISCV COVE, or ARM
CCA.

The "TSM" (TEE Security Manager) is a concept in the TDISP specification
of an agent that mediates between a "DSM" (Device Security Manager) and
system software in both a VMM and a confidential VM. A VMM uses TSM ABIs
to setup link security and assign devices. A confidential VM uses TSM
ABIs to transition an assigned device into the TDISP "RUN" state and
validate its configuration. From a Linux perspective the TSM abstracts
many of the details of TDISP, IDE, and CMA. Some of those details leak
through at times, but for the most part TDISP is an internal
implementation detail of the TSM.

CONFIG_PCI_TSM adds an "authenticated" attribute and "tsm/" subdirectory
to pci-sysfs. Consider that the TSM driver may itself be a PCI driver.
Userspace can watch for the arrival of a "TSM" device,
/sys/class/tsm/tsm0/uevent KOBJ_CHANGE, to know when the PCI core has
initialized TSM services.

The operations that can be executed against a PCI device are split into
two mutually exclusive operation sets, "Link" and "Security" (struct
pci_tsm_{link,security}_ops). The "Link" operations manage physical link
security properties and communication with the device's Device Security
Manager firmware. These are the host side operations in TDISP. The
"Security" operations coordinate the security state of the assigned
virtual device (TDI). These are the guest side operations in TDISP.

Only "link" (Secure Session and physical Link Encryption) operations are
defined at this stage. There are placeholders for the device security
(Trusted Computing Base entry / exit) operations.

The locking allows for multiple devices to be executing commands
simultaneously, one outstanding command per-device and an rwsem
synchronizes the implementation relative to TSM registration/unregistration
events.

Thanks to Wu Hao for his work on an early draft of this support.

Cc: Lukas Wunner <lukas@wunner.de>
Cc: Samuel Ortiz <sameo@rivosinc.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Alexey Kardashevskiy <aik@amd.com>
Co-developed-by: Xu Yilun <yilun.xu@linux.intel.com>
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Link: https://patch.msgid.link/20251031212902.2256310-5-dan.j.williams@intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2025-11-03 19:27:41 -08:00
..
80211
acpi
backlight
coco Merge branch 'for-6.16/tsm-mr' into tsm-next 2025-05-12 22:12:44 -07:00
crypto mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
cxl CXL changes for v6.18 2025-10-04 12:02:50 -07:00
dmaengine dmaengine updates for v6.16 2025-06-05 08:49:30 -07:00
driver-model docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
early-userspace docs: initramfs: file data alignment via name padding 2025-08-20 16:02:56 -07:00
firmware docs: driver-api: firmware: clarify userspace requirements 2025-03-17 17:04:32 -06:00
fpga
gpio Documentation: gpio: add documentation about using software nodes 2025-08-26 15:27:04 +02:00
hte
i3c docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
iio docs: iio: Allow creating cross-references ABI 2025-02-18 13:42:46 -07:00
md
media It has been a relatively busy cycle in docsland, with changes all over: 2025-10-03 17:16:13 -07:00
mei
memory-devices
mmc Documentation: mmc: Add mmc-test doc 2024-09-05 12:13:39 +02:00
mtd
nfc
nvdimm docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
pci PCI/TSM: Establish Secure Sessions and Link Encryption 2025-11-03 19:27:41 -08:00
phy phy: core: Remove unused phy_pm_runtime_(allow|forbid) 2025-03-10 12:58:07 +05:30
pldmfw
pm docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
rapidio
serial serial: Remove unused uart_get_console 2025-06-19 13:24:16 +02:00
soundwire soundwire: update Intel BPT message length limitation 2025-06-09 21:42:18 +05:30
surface_aggregator
thermal Documentation: Fix driver-api typos 2025-08-18 10:17:49 -06:00
tty tty: fix tty_port_tty_*hangup() kernel-doc 2025-06-24 15:32:56 +01:00
usb docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
virtio
xilinx
aperture.rst
auxiliary_bus.rst drivers/base: Remove unused auxiliary_find_device 2024-10-14 08:21:09 +02:00
basics.rst Docs: driver-api/basics: add kobject_event interfaces 2025-05-19 08:02:14 -06:00
clk.rst
component.rst
connector.rst
console.rst
devfreq.rst
device-io.rst docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
device_link.rst
dma-buf.rst
dpll.rst dpll: add phase-offset-avg-factor device attribute to netlink spec 2025-09-29 18:57:41 -07:00
edac.rst
eisa.rst docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
extcon.rst Documentation: extcon: add documentation for Extcon subsystem 2024-12-08 21:59:40 +09:00
firewire.rst firewire: core: expose kernel API to schedule work item to process isochronous context 2024-09-08 13:05:48 +09:00
frame-buffer.rst
generic-counter.rst docs: arm: generic-counter: Allow creating cross-references for ABI 2025-02-18 13:42:46 -07:00
hsi.rst
i2c.rst
index.rst tsm-mr: Add TVM Measurement Register support 2025-05-08 19:17:33 -07:00
infiniband.rst docs: driver-api/infiniband.rst: fix Kerneldoc markup 2025-03-04 09:47:38 -07:00
infrastructure.rst driver core: add a faux bus for use when a simple device/bus is needed 2025-02-13 16:58:51 +01:00
input.rst Add libps2 to the input section of driver-api 2024-07-03 16:20:49 -06:00
interconnect.rst
io-mapping.rst
io_ordering.rst
ioctl.rst
ipmb.rst
ipmi.rst docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
isa.rst
libata.rst Documentation: driver-api: Update libata error handler information 2025-07-16 09:31:43 +02:00
mailbox.rst
men-chameleon-bus.rst
message-based.rst
misc_devices.rst
miscellaneous.rst
mtdnand.rst
ntb.rst Documentation: NTB: Fix typo 2025-05-19 09:04:21 -06:00
nvmem.rst nvmem: Remove unused nvmem cell table support 2025-05-21 14:28:27 +02:00
parport-lowlevel.rst
pin-control.rst pci-v6.18-changes 2025-10-06 10:41:03 -07:00
pps.rst Documentation: driver-api: pps: Add Intel Timed I/O PPS generator 2025-02-21 10:46:49 +01:00
ptp.rst
pwm.rst docs: pwm: Adapt Locking paragraph to reality 2025-07-07 08:39:36 +02:00
pwrseq.rst Documentation: pwrseq: Fix trivial misspellings 2024-11-22 10:36:53 -07:00
regulator.rst
reset.rst
rfkill.rst
s390-drivers.rst
scsi.rst docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
slimbus.rst
sm501.rst
spi.rst docs: driver-api: fix spelling of "buses". 2025-09-18 10:40:46 -06:00
switchtec.rst
sync_file.rst
target.rst
tee.rst
uio-howto.rst
vfio-mediated-device.rst
vfio-pci-device-specific-driver-acceptance.rst
vfio.rst
vme.rst
w1.rst
wbrf.rst
wmi.rst platform/x86: wmi: Update WMI driver API documentation 2024-10-06 12:48:52 +02:00
xillybus.rst
zorro.rst