Skip to contentSkip to conversation

content: Reserve virtio-nsm device ID

PATCH Superseded Petre Eftime 2 participants 3 messages May 21, 2020 – May 27, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 content: Reserve virtio-nsm device ID

The NitroSecureModule is a device with a very stripped down Trusted Platform Module functionality, which is used in the context of a Nitro Enclave (see https://lkml.org/lkml/2020/4/21/1020)
to provide boot time measurement and attestation.

Since this device provides some critical cryptographic operations, there are a series of operations which are required to have guarantees of atomicity, ordering and consistency: operations fully succeed or fully fail, including when some external events might interfere in the
process: live migration, crashes, etc; any failure in the critical section requires termination of the enclave it is attached to, so the device needs to be as resilient as possible, simplicity is strongly desired.

To account for that, the device and driver are made to have very few error cases in the critical path and the operations themselves can be rolled back and retried if events happen outside the critical area, while processing a request. The driver itself can be made very simple and thus is easily portable.

Since the requests can be handled directly in the virtio queue, serving most requests requires no additional buffering or memory allocations on the host side.

---
 content.tex | 2 ++
 1 file changed, 2 insertions(+)
content.tex +2 -0
index 91735e3..6eee371 100644
@@ -2801,6 +2801,8 @@ \chapter{Device Types}\label{sec:Device Types}
 \hline
 31         &   Video decoder device \\
 \hline
+0xec2000   &   NitroSecureModule \\
+\hline
 \end{tabular}
 
 Some of the devices above are unspecified by this document,
Signature · 23 lines
2.20.1




Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/
#1 lore raw
Quoted 34 lines · Petre Eftime

The NitroSecureModule is a device with a very stripped down Trusted Platform Module functionality, which is used in the context of a Nitro Enclave (see https://lkml.org/lkml/2020/4/21/1020)
to provide boot time measurement and attestation.

Since this device provides some critical cryptographic operations, there are a series of operations which are required to have guarantees of atomicity, ordering and consistency: operations fully succeed or fully fail, including when some external events might interfere in the
process: live migration, crashes, etc; any failure in the critical section requires termination of the enclave it is attached to, so the device needs to be as resilient as possible, simplicity is strongly desired.

To account for that, the device and driver are made to have very few error cases in the critical path and the operations themselves can be rolled back and retried if events happen outside the critical area, while processing a request. The driver itself can be made very simple and thus is easily portable.

Since the requests can be handled directly in the virtio queue, serving most requests requires no additional buffering or memory allocations on the host side.

---
 content.tex | 2 ++
 1 file changed, 2 insertions(+)
content.tex +0 -0
index 91735e3..6eee371 100644

content.tex \chapter{Device Types}\label{sec:Device Types} · line 2804

Quoted 4 lines
content.tex +1 -0
@@ -2801,6 +2801,8 @@ \chapter{Device Types}\label{sec:Device Types}
 \hline
 31         &   Video decoder device \\
 \hline
+0xec2000   &   NitroSecureModule \\

The PCI and CCW transports represent VIRTIO device type IDs with 16-bit fields. Is there a reason why the NitroSecureModule device should only work with VIRTIO transports that support >16-bit device type IDs?

If not, then please pick the next low-numbered ID instead.

Stefan

#2 lore raw
Quoted 43 lines · Stefan Hajnoczi
Quoted 34 lines · Petre Eftime

The NitroSecureModule is a device with a very stripped down Trusted Platform Module functionality, which is used in the context of a Nitro Enclave (see https://lkml.org/lkml/2020/4/21/1020)
to provide boot time measurement and attestation.

Since this device provides some critical cryptographic operations, there are a series of operations which are required to have guarantees of atomicity, ordering and consistency: operations fully succeed or fully fail, including when some external events might interfere in the
process: live migration, crashes, etc; any failure in the critical section requires termination of the enclave it is attached to, so the device needs to be as resilient as possible, simplicity is strongly desired.

To account for that, the device and driver are made to have very few error cases in the critical path and the operations themselves can be rolled back and retried if events happen outside the critical area, while processing a request. The driver itself can be made very simple and thus is easily portable.

Since the requests can be handled directly in the virtio queue, serving most requests requires no additional buffering or memory allocations on the host side.

---
  content.tex | 2 ++
  1 file changed, 2 insertions(+)
content.tex +0 -0
index 91735e3..6eee371 100644

content.tex \chapter{Device Types}\label{sec:Device Types} · line 2804

Quoted 4 lines
content.tex +1 -0
@@ -2801,6 +2801,8 @@ \chapter{Device Types}\label{sec:Device Types}
  \hline
  31         &   Video decoder device \\
  \hline
+0xec2000   &   NitroSecureModule \\

The PCI and CCW transports represent VIRTIO device type IDs with 16-bit fields. Is there a reason why the NitroSecureModule device should only work with VIRTIO transports that support >16-bit device type IDs?

Quoted 3 lines

If not, then please pick the next low-numbered ID instead.

Stefan

I saw that there's already a vote open for device ID 32, so I went with 33 instead. I was under the impression that virtio device IDs are always 32bit, based on the data types used in Linux to express them.

Best,

Petre Eftime

Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.

This publicly archived list offers a means to provide input to the OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and to minimize spam in the list archive, subscription is required before posting.

Subscribe: [email protected]
Unsubscribe: [email protected]
List help: [email protected]
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/