Changes since v2 [1]: - drivers/virt/coco/guest rename merged to tsm.git#next - Clarify usage and requirements for pci_ide_init_nr_streams() (Dionna) - Misc fixups (Dionna) - Fix sel_ide_offset() to incorporate ide_cap (Aneesh, Yilun) - Allow at least 1 stream when enforcing uniform address association register layout (Yilun) - Fix host-bridge-emulation for PCI_DOMAINS_GENERIC platform (Suzuki) - Export pci_ide_to_settings() as a helper for TSM drivers (Yilun) - Set Stream ID early, prior to IDE_KM (Alexey) - Catch IDE_KM initial setup failures with pci_ide_stream_enable() errors (Yilun). - Fix missing initialization of nr_link_ide (caught by samples/devsec/bus test) - Add some reference documentation to the devsec_tsm_connect() sample operation to clarify implementation expectations (Zhi) - Expand the possible Device Security Managers from only PF0 of a device hosting TDIs, to include Upstream Ports with downstream endpoints as TDIs - Add bind, unbind, guest_req, and accept operations (Yilun) [1]: http://lore.kernel.org/174107245357.1288555.10863541957822891561.stgit@xxxxxxxxxxxxxxxxxxxxxxxxx Launch of tsm.git#staging [2] ----------------------------- As mentioned on v2, tsm.git#staging is proposed as a neutral location to collect device-security infrastructure from multiple vendors. I.e. collect all the vendor trees to resolve conflicts, code or otherwise. For now it does not contain kvm-coco-queue, but am open to merging that if needed for some device-security-flows. Yilun showed a potential flow for the end-to-end API changes here [1], do review that and point out where it may not work for a different architecture. A goal of mine is to catch sample/devsec/ up with that diagram to prove out and unit test the end-to-end mechanism without needing hardware. It has already found bugs while revising this new set. [2]: https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git/log/?h=staging [3]: http://lore.kernel.org/aCYsNSFQJZzHVOFI@yilunxu-OptiPlex-7050 Original Cover letter: ---------------------- Trusted execution environment (TEE) Device Interface Security Protocol (TDISP) is a chapter name in the PCI specification. It describes an alphabet soup of mechanisms, SPDM, CMA, IDE, TSM/DSM, that system software uses to establish trust in a device and assign it to a confidential virtual machine (CVM). It is protocol for dynamically extending the trusted computing boundary (TCB) of a CVM with a PCI device interface that can issue DMA to CVM private memory. The acronym soup problem is enhanced by every major platform vendor having distinct TEE Security Manager (TSM) API implementations / capabilities, and to a lesser extent, every potential endpoint Device Security Manager (DSM) having its own idiosyncratic behaviors around TDISP state transitions. Despite all that opportunity for differentiation, there is a significant portion of the implementation that is cross-vendor common. However, it is difficult to develop, debate, test and settle all those pieces absent a low level TSM driver implementation to pull it all together. The proposal is incrementally develop the shared infrastructure on top of a sample TSM driver implementation to enable clean vendor agnostic discussions about the commons. "samples/devsec/" is meant to be: just enough emulation to exercise all the core infrastructure, a reference implementation, and a simple unit test. The sample also enables coordination with the native PCI device security effort [4]. [4]: http://lore.kernel.org/cover.1719771133.git.lukas@xxxxxxxxx Dan Williams (11): coco/tsm: Introduce a core device for TEE Security Managers PCI/IDE: Enumerate Selective Stream IDE capabilities PCI/TSM: Authenticate devices via platform TSM PCI: Enable host-bridge emulation for PCI_DOMAINS_GENERIC platforms PCI: vmd: Switch to pci_bus_find_emul_domain_nr() samples/devsec: Introduce a PCI device-security bus + endpoint sample PCI: Add PCIe Device 3 Extended Capability enumeration PCI/IDE: Add IDE establishment helpers PCI/IDE: Report available IDE streams PCI/TSM: Report active IDE streams samples/devsec: Add sample IDE establishment Xu Yilun (2): PCI/TSM: support TDI related operations for host TSM driver PCI/TSM: Add Guest TSM Support Documentation/ABI/testing/sysfs-bus-pci | 45 + Documentation/ABI/testing/sysfs-class-tsm | 20 + .../ABI/testing/sysfs-devices-pci-host-bridge | 51 ++ MAINTAINERS | 7 +- drivers/pci/Kconfig | 28 + drivers/pci/Makefile | 2 + drivers/pci/controller/pci-hyperv.c | 53 +- drivers/pci/controller/vmd.c | 33 +- drivers/pci/ide.c | 525 ++++++++++++ drivers/pci/pci-sysfs.c | 4 + drivers/pci/pci.c | 43 +- drivers/pci/pci.h | 19 + drivers/pci/probe.c | 34 +- drivers/pci/remove.c | 3 + drivers/pci/tsm.c | 782 ++++++++++++++++++ drivers/virt/coco/Kconfig | 2 + drivers/virt/coco/Makefile | 1 + drivers/virt/coco/host/Kconfig | 6 + drivers/virt/coco/host/Makefile | 6 + drivers/virt/coco/host/tsm-core.c | 144 ++++ include/linux/pci-ide.h | 76 ++ include/linux/pci-tsm.h | 211 +++++ include/linux/pci.h | 29 + include/linux/tsm.h | 11 + include/uapi/linux/pci_regs.h | 91 +- samples/Kconfig | 16 + samples/Makefile | 1 + samples/devsec/Makefile | 10 + samples/devsec/bus.c | 711 ++++++++++++++++ samples/devsec/common.c | 26 + samples/devsec/devsec.h | 40 + samples/devsec/tsm.c | 218 +++++ 32 files changed, 3170 insertions(+), 78 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-tsm create mode 100644 Documentation/ABI/testing/sysfs-devices-pci-host-bridge create mode 100644 drivers/pci/ide.c create mode 100644 drivers/pci/tsm.c create mode 100644 drivers/virt/coco/host/Kconfig create mode 100644 drivers/virt/coco/host/Makefile create mode 100644 drivers/virt/coco/host/tsm-core.c create mode 100644 include/linux/pci-ide.h create mode 100644 include/linux/pci-tsm.h create mode 100644 samples/devsec/Makefile create mode 100644 samples/devsec/bus.c create mode 100644 samples/devsec/common.c create mode 100644 samples/devsec/devsec.h create mode 100644 samples/devsec/tsm.c base-commit: 7515f45c165269b72ee739e6fc26cc2ef928fc1b -- 2.49.0