Skip to content

Commit

Permalink
specification: Define the interface unbinding flows
Browse files Browse the repository at this point in the history
Fixes #57

Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
sameo committed Apr 28, 2024
1 parent f8471cc commit 317be1e
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions specification/07-theory_operations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,71 @@ TVM ->> TVM: Use device interface

=== Interface Unbinding

As the platform resources owner, only the host supervisor domain manager may
decide to unbind an interface from a TVM. At any moment, it can choose to do so
through the `sbi_covh_unbind_interface()` `COVH` ABI. The targeted TSM services
the request by moving the TDI from the TDISP `CONFIG_LOCKED` or `RUN` state back
to the `CONFIG_UNLOCKED` one.

The host supervisor domain manager may decide to unbind a TDI from a TVM for
many reasons. First of all, the TVM itself could be requesting that a TDI be
unbound through the `sbi_covg_stop_interface()` `COVG` ABI, because e.g. it no
longer needs the TDI for its operation or when shutting down. The host
supervisor domain manager can also asynchronously choose to reclaim a TDI from
a TVM, because the TVM or the TDI is misbehaving or unresponsive, or simply
because it needs to re-assign a TDI to another TVM. Once unbound, a TDI can then
be assigned to any TVM on any security domain.

Unbinding a TDI from a TVM is first and foremost a resource management
operation, and as such it must be designed to robustly address multiple error
conditions and states that either the TDI or the TVM may have reached, while at
the same time maintaining confidential data integrity and confidentiality. The
operation must complete in order to release all TDI related system resources, and
thus does not require any interaction with neither the TDI nor the TVM.

==== Unbinding Flow

Unbinding an interface from a TVM goes through the following steps:

1. The host supervisor domain manager initiates the unbinding operation through
the `sbi_covh_unbind_interface()` `COVH` ABI. The TSM rejects that request if
the targeted TDI and TVM are not bound together.
2.

.Device Interface Unbinding - Unbind Interface
[source,mermaid]
....
%%{init: {'theme': 'neutral', 'themeVariables': {'darkMode': true}, "flowchart" : { "curve" : "basis" } } }%%
sequenceDiagram
autonumber
participant TDI as Device Interface
participant DSM as Device DSM
participant VMM as Host Supervisor Domain Manager (VMM)
participant TSM
participant IOMMU
note over TDI: CONFIG_LOCKED or RUN
VMM ->> TSM: [COVH] sbi_covh_unbind_interface()
TSM ->> TSM: Generate TDISP STOP_INTERFACE_REQUEST
TSM ->> VMM: [COVH] spdm_req(STOP_INTERFACE_REQUEST)
VMM ->> DSM: [DOE] SPDM_STOP_INTERFACE_REQUEST
DSM ->> TDI: STOP
TDI ->> TDI: Abort or complete all pending DMA requests
TDI ->> TDI: Scrub all TDI secrets and confidential data
note over TDI: CONFIG_UNLOCKED
DSM ->> VMM: [DOE] SPDM_STOP_INTERFACE_RESPONSE
VMM ->> TSM: [COVH] spdm_resp(STOP_INTERFACE_RESPONSE)
TSM ->> TSM: Decrypt STOP_INTERFACE_RESPONSE
TSM ->> IOMMU: Disable IOMMU translation for devif_id
TSM ->> IOMMU: Clear all C-IOMMU mappings
TSM ->> TSM: Disable G-stage MMIO mapping for devif_id
TSM ->> VMM: [COVH] sbi_covh_unbind_interface()
....

=== Session Key Update

In TEE-IO architecture, when connecting to a device, a TSM establishes an SPDM
Expand Down

0 comments on commit 317be1e

Please sign in to comment.