Skip to contentSkip to conversation

Add virtio rpmb device specification

PATCH Superseded Huang Yang 1 participant 2 messages Aug 28, 2019

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Huang Yang

author
#0 lore raw

v4 cover Add virtio rpmb device specification

The RPMB authentication key is owned by the user (normally it’s a TEE or other TCB) who calls virtio rpmb driver, but not owned by the virtio rpmb driver.
As a result, the user is in charge of calculating the MAC, packing the RPMB frame and sending it to the driver.
Any changes on RPMB frame definition, including order, size, crypto algorithm will cause to a different MAC.
If the frame definition is changed, it indicates software has to recognize it’s running on a VM or not, and to maintain two different implementations to adapt virtio RPMB device and hardware RPMB device.
In order to keep compatibility with native usage, keeping the definition of virtio RPMB frame same as the hardware specification is perferred.

struct virtio_rpmb_frame {
        u8 stuff[196];
        u8 key_mac[32]; <------------------------------
        u8 data[256]; ---------------->|                       ^
        u8 nonce[16]; ---------------->|                      ^
        be32 write_counter; -------->|             HMAC-SHA256()
        be16 address; ---------------->|-------------> | <-----------Authentication Key
        be16 block_count; ---------->|
        be16 result; ------------------>|
        be16 req_resp; -------------->|
};

v3 -> v4:
1. Remove multiple RPMB targets.
2. Remove NVMe RPMB.
3. typo fix.
4. Some wording changes for better understanding.
5. Add conformance.

v2 -> v3:
1. Remove conformance changes temporarily
since the draft requires reviews and updates at this phase.
2. Add eMMC, UFS and NVMe as Normative References.
3. Add more details on:
RPMB frame
Request Type/Response Type
4. Add differentiation JEDEC RPMB and NVMe RPMB.
5. Define config layout
6. Illustrate behaviors of all RPMB requests 7. Remove RPMB device ID reservation, it will be submitted with an independent patch.

v1 -> v2:
1. update conformance.
2. wordings change:
first initialization -> first device initialization device size -> device capacity
3. update Device Operation:
add more decriptions on write counter, key and write operations.

Huang Yang (1):
Add virtio rpmb device specification

 conformance.tex  |  20 ++++-
 content.tex      |   1 +
 introduction.tex |   6 ++
 virtio-rpmb.tex  | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 264 insertions(+), 1 deletion(-)
 create mode 100644 virtio-rpmb.tex
Signature · 6 lines
2.7.4


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
author
#1 lore raw

PATCH v4 1/1 Add virtio rpmb device specification

It is a virtio based RPMB (Replay Protected Memory Block) device.

v3 -> v4:
1. Remove multiple RPMB targets.
2. Remove NVMe RPMB.
3. typos fix.
4. Some wording changes for better understanding.
5. Add conformance.

---
 conformance.tex  |  20 ++++-
 content.tex      |   1 +
 introduction.tex |   6 ++
 virtio-rpmb.tex  | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 264 insertions(+), 1 deletion(-)
 create mode 100644 virtio-rpmb.tex
conformance.tex +19 -1
index 0ac58aa..4e8d4ae 100644
@@ -22,7 +22,7 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
   \begin{itemize}
     \item Clause \ref{sec:Conformance / Device Conformance}.
     \item One of clauses \ref{sec:Conformance / Device Conformance / PCI Device Conformance}, \ref{sec:Conformance / Device Conformance / MMIO Device Conformance} or \ref{sec:Conformance / Device Conformance / Channel I/O Device Conformance}.
-    \item One of clauses \ref{sec:Conformance / Device Conformance / Network Device Conformance}, \ref{sec:Conformance / Device Conformance / Block Device Conformance}, \ref{sec:Conformance / Device Conformance / Console Device Conformance}, \ref{sec:Conformance / Device Conformance / Entropy Device Conformance}, \ref{sec:Conformance / Device Conformance / Traditional Memory Balloon Device Conformance}, \ref{sec:Conformance / Device Conformance / SCSI Host Device Conformance}, \ref{sec:Conformance / Device Conformance / Input Device Conformance}, \ref{sec:Conformance / Device Conformance / Crypto Device Conformance} or \ref{sec:Conformance / Device Conformance / Socket Device Conformance}.
+    \item One of clauses \ref{sec:Conformance / Device Conformance / Network Device Conformance}, \ref{sec:Conformance / Device Conformance / Block Device Conformance}, \ref{sec:Conformance / Device Conformance / Console Device Conformance}, \ref{sec:Conformance / Device Conformance / Entropy Device Conformance}, \ref{sec:Conformance / Device Conformance / Traditional Memory Balloon Device Conformance}, \ref{sec:Conformance / Device Conformance / SCSI Host Device Conformance}, \ref{sec:Conformance / Device Conformance / Input Device Conformance}, \ref{sec:Conformance / Device Conformance / Crypto Device Conformance}, \ref{sec:Conformance / Device Conformance / Socket Device Conformance} or \ref{sec:Conformance / Device Conformance / RPMB Device Conformance}.
     \item Clause \ref{sec:Conformance / Legacy Interface: Transitional Device and Transitional Driver Conformance}.
   \end{itemize}
 \end{description}
@@ -183,6 +183,14 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{drivernormative:Device Types / Socket Device / Device Operation / Device Events}
 \end{itemize}
 
+\conformance{\subsection}{RPMB Driver Conformance}\label{sec:Conformance / Driver Conformance / RPMB Driver Conformance}
+
+A RPMB driver MUST conform to the following normative statements:
+
+\begin{itemize}
+\item \ref{drivernormative:Device Types / RPMB Device / Device Operation}
+\end{itemize}
+
 \conformance{\section}{Device Conformance}\label{sec:Conformance / Device Conformance}
 
 A device MUST conform to the following normative statements:
@@ -338,6 +346,16 @@ \section{Conformance Targets}\label{sec:Conformance / Conformance Targets}
 \item \ref{devicenormative:Device Types / Socket Device / Device Operation / Receive and Transmit}
 \end{itemize}
 
+\conformance{\subsection}{RPMB Device Conformance}\label{sec:Conformance / Device Conformance / RPMB Device Conformance}
+
+An RPMB device MUST conform to the following normative statements:
+
+\begin{itemize}
+\item \ref{devicenormative:Device Types / RPMB Device / Device Initialization}
+\item \ref{devicenormative:Device Types / RPMB Device / Device Operation / Device Operation: Request Queue}
+\item \ref{devicenormative:Device Types / RPMB Device / Device Operation}
+\end{itemize}
+
 \conformance{\section}{Legacy Interface: Transitional Device and Transitional Driver Conformance}\label{sec:Conformance / Legacy Interface: Transitional Device and Transitional Driver Conformance}
 A conformant implementation MUST be either transitional or
 non-transitional, see \ref{intro:Legacy
content.tex +1 -0
index ee0d7c9..2573bd5 100644
@@ -5677,6 +5677,7 @@ \subsubsection{Legacy Interface: Framing Requirements}\label{sec:Device
 \input{virtio-input.tex}
 \input{virtio-crypto.tex}
 \input{virtio-vsock.tex}
+\input{virtio-rpmb.tex}
 
 \chapter{Reserved Feature Bits}\label{sec:Reserved Feature Bits}
 
introduction.tex +6 -0
index c96acf9..b304777 100644
@@ -60,6 +60,12 @@ \section{Normative References}\label{sec:Normative References}
 	\phantomsection\label{intro:SCSI MMC}\textbf{[SCSI MMC]} &
         SCSI Multimedia Commands,
         \newline\url{http://www.t10.org/cgi-bin/ac.pl?t=f&f=mmc6r00.pdf}\\
+        \phantomsection\label{intro:eMMC}\textbf{[eMMC]} &
+        eMMC Electrical Standard (5.1),
+        \newline\url{https://www.jedec.org/standards-documents/docs/jesd84-b51}\\
+        \phantomsection\label{intro:UFS}\textbf{[UFS]} &
+        UNIVERSAL FLASH STORAGE (UFS), Version 3.0,
+        \newline\url{https://www.jedec.org/standards-documents/docs/jesd220c}\\
 
 \end{longtable}
 
virtio-rpmb.tex new file +238 -0

238 lines not on this page · raw message

Signature · 6 lines
2.7.4


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]