Skip to content

Commit 93c762c

Browse files
authored
Merge pull request #2187 from pareenaverma/content_review
Tech review of DA virtio CCA LP
2 parents 2a1ca24 + 43886d5 commit 93c762c

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

content/learning-paths/servers-and-cloud-computing/cca-device-attach/1-introduction.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ layout: learningpathall
88

99
Arm’s *Realm Management Extension (RME)* is a key security feature introduced in
1010
the Armv9-A architecture. It enables a new form of hardware-enforced isolation
11-
designed to support _confidential computing_. It defines the set of hardware
12-
features and properties that are required to comply with the Arm *Confidential
13-
Computing Architecture (CCA)* architecture.
11+
designed to support Confidential Computing. It defines the set of hardware
12+
features and properties that are required to comply with the Arm's Confidential
13+
Computing Architecture (CCA) architecture.
1414

15-
At the heart of RME is the concept of a *Realm*, a protected execution
16-
environment that operates independently from the conventional *Normal World*
17-
(used by operating systems and applications) and the *Secure World* (used by
15+
At the heart of RME is the concept of a Realm, a protected execution
16+
environment that operates independently from the conventional Normal World
17+
(used by operating systems and applications) and the Secure World (used by
1818
trusted firmware or TEE). Realms are managed by a new privileged entity called
19-
the *Realm Management Monitor (RMM)* and are enforced by the hardware via the
20-
*Granule Protection Table (GPT)* and *Granule Transitioning* mechanism.
19+
the Realm Management Monitor (RMM) and are enforced by the hardware via the
20+
Granule Protection Table (GPT) and Granule Transitioning mechanism.
2121

2222
Realms allow lower-privileged software, such as an application or a virtual
2323
machine, to protect its content and execution from attacks by higher-privileged
@@ -27,4 +27,4 @@ components that manage the resources that the Realm uses.
2727

2828
To be useful, a Realm has to interact with the rest of the world at some point.
2929
For example, a network interface is likely to be needed. This learning path will
30-
teach you how devices are attached and used by Realms.
30+
show you how devices are attached and used by Realms.

content/learning-paths/servers-and-cloud-computing/cca-device-attach/2-virtio.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: "Device attach - part 1: virtio"
2+
title: "Device attach: virtio"
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
This section is a high level overview of VirtIO and Bounce Buffers, and how they
9+
This section provides a high level overview of VirtIO and Bounce Buffers, and how they
1010
relate to CCA Realms.
1111

1212
A Realm has to use physical devices at some point to interact with the external
13-
and / or physical world. The easiest way to do this is by using VirtIO, which
14-
provides a fast high level emulation layer. This can be seen as the level-0 of
13+
and or physical world. The easiest way to do this is by using VirtIO, which
14+
provides a fast high level emulation layer. This can be viewed as the first level of
1515
device attach.
1616

17-
As will be seen later in this learning path, more evolved device attach can be
17+
More evolved device attach features can be
1818
performed leveraging hardware security features like PCIe-TDISP (**T**EE
1919
**D**evice **I**nterface **S**ecurity **P**rotocol) and PCIe-IDE (**I**ntegrity
2020
and **D**ata **E**ncryption), where the host OS can assign a physical device to
@@ -27,8 +27,8 @@ and include it in its base and measurements.
2727

2828
VirtIO is an abstraction layer for virtual devices in virtualized environments.
2929
It provides standardized and efficient interfaces between guest virtual machines
30-
(VMs) and host devices, making it easier to develop _paravirtualized_ drivers.
31-
_Paravirtualized_ means that the guest OS is aware it’s running in a virtualized
30+
(VMs) and host devices, making it easier to develop paravirtualized drivers.
31+
Paravirtualized means that the guest OS is aware it’s running in a virtualized
3232
environment and can use optimized drivers (VirtIO) to communicate with virtual
3333
hardware. Emulating hardware devices (like NICs or disks) for VMs is slow and
3434
inefficient. VirtIO provides a standardized and efficient interface that allows
@@ -45,9 +45,11 @@ VirtIO is most commonly used with KVM/QEMU virtualization. Example drivers are:
4545

4646
### How VirtIO works in VMs
4747

48+
Here is an overview of how VirtIO works in Virtual Machines:
49+
4850
1. The Host Hypervisor (e.g., QEMU/KVM) exposes VirtIO “backend” devices.
4951
2. The guest OS loads VirtIO _frontend_ drivers (e.g., `virtio_net`,
50-
`virtio_blk`) that speak the VirtIO protocol.
52+
`virtio_blk`) that communicate using the VirtIO protocol.
5153
3. Communication happens via shared memory (`virtqueues`) for I/O operations,
5254
avoiding full device emulation.
5355
4. Devices are exposed over the PCI or MMIO bus to the guest.
@@ -60,15 +62,12 @@ driver to send/receive packets via shared buffers.
6062

6163
### What are bounce buffers?
6264

63-
Bounce buffers are a generic mechanism part of the Linux kernel. They are
64-
temporary memory buffers used in the Linux kernel to handle situations where
65-
direct memory access (DMA) can’t be performed directly on the original data
66-
buffer. This often happens because:
65+
Bounce buffers are temporary memory buffers used in the Linux kernel to handle situations where direct memory access (DMA) can’t be performed directly on the original data buffer. This often happens because:
6766
1. The original buffer is not physically contiguous.
6867
2. The buffer is in high memory or not accessible to the device.
6968
3. The buffer doesn’t meet alignment or boundary requirements of the device.
7069

71-
### Why _bounce_ buffers?
70+
### Why bounce buffers?
7271

7372
Data _bounces_ between:
7473
- The original buffer (in user/kernel space) and
@@ -88,14 +87,14 @@ that:
8887
- Even Direct Memory Access (DMA) from peripherals or untrusted drivers cannot
8988
access Realm data.
9089

91-
This design ensures confidentiality but introduces a problem: *how can Realms
92-
interact with untrusted components*, such as:
90+
This design ensures confidentiality but introduces a problem: How can Realms
91+
interact with untrusted components, such as:
9392
- Network stacks in the host OS,
9493
- Storage subsystems,
9594
- I/O devices managed by untrusted drivers?
9695

9796
The solution to safely exchange data between a Realm and the outside World is to
98-
use _bounce buffers_ as an intermediary !
97+
use bounce buffers as an intermediary.
9998

10099
### How bounce buffers are used with RME
101100

@@ -117,27 +116,27 @@ This pattern preserves confidentiality and integrity of Realm data, since:
117116

118117
### Confidentiality preserved with bounce buffers, really?
119118

120-
In the previous section, it was mentioned that _bounce buffers preserves
121-
confidentiality_, a sentence which deserves a bit more thoughts. Bounce buffers
119+
In the previous section, it was mentioned that bounce buffers preserve
120+
confidentiality. Lets dive a little deeper into that. Bounce buffers
122121
are nothing more than an explicitly shared temporary area between the Realm
123122
world and the outside world. This does indeed preserve the confidentiality of
124123
all the rest of the Realm data. On the other hand, for the data being
125124
transferred, it is leaving the Realm world and will only remain confidential if it
126-
is encrypted in some ways, e.g. for network traffic, TLS should be used.
125+
is encrypted in some way, e.g. for network traffic, TLS should be used.
127126

128127
## Seeing a Realm's bounce buffers at work
129128

130-
Let's put this to work and check for ourselves that bounce buffers are used. This
131-
will build on the Key Broker demo that was used in the [CCA
129+
Let's put this to work and check for ourselves that bounce buffers are used. The
130+
steps in this section will build on the Key Broker demo that was used in the [CCA
132131
Essentials learning path](/learning-paths/servers-and-cloud-computing/cca-essentials/example/),
133132
demonstrating an end-to-end attestation.
134133

135-
### Start the **K**eyb **B**roker **Server** (KBS)
134+
### Start the Key Broker Server (KBS)
136135

137136
First, pull the docker container image with the pre-built KBS, and then run the container:
138137

139138
```bash
140-
docker pull armswdev/cca-learning-path:cca-key-broker-v2
139+
docker pull armswdev/cca-learning-path:cca-key-broker-v2
141140
docker run --rm -it armswdev/cca-learning-path:cca-key-broker-v2
142141
```
143142

@@ -181,7 +180,7 @@ INFO starting service: "actix-web-service-172.17.0.2:8088", workers: 16, listeni
181180
### Get into a Realm
182181

183182
With the Key Broker Server running in one terminal, open up a new terminal in
184-
which you will run the **K**ey **B**roker **C**lient (KBC). The intent is to
183+
which you will run the Key Broker Client (KBC). The intent is to
185184
observe that the data transmitted over the network (thru `virtio_net`) are
186185
indeed using bounce buffers.
187186

@@ -231,7 +230,7 @@ cd /cca
231230
```
232231

233232
You should see the realm boot. Note that `lkvm` is invoked with `--network
234-
mode=user`, which makes the guest see the network thru a VirtIO device.
233+
mode=user`, which makes the guest see the network through a VirtIO device.
235234

236235
After boot up, which might take some time, you will be prompted to log in at the
237236
guest Linux prompt. Use root again as the username:
@@ -306,10 +305,10 @@ hwmon pwm
306305
i2c qcom_aoss
307306
```
308307

309-
As shown in the above transcript, you should get a list of the available trace
308+
As shown above, you should see a list of the available trace
310309
points.
311310

312-
Now, enable the kernel tracing infrastructure together with the bounce buffer
311+
Now, enable the kernel tracing infrastructure together with bounce buffer
313312
tracing, read the trace in the background (filtering on `keybroker-app-`) and
314313
run the Key Broker Client application in the realm, using the endpoint address
315314
that the Key Broker Server is listening on (from the other terminal):
@@ -324,7 +323,7 @@ keybroker-app -v --endpoint http://172.17.0.2:8088 skywalker
324323
In the `keybroker-app`command above, `skywalker` is the key name that is
325324
requested from the KBS.
326325

327-
You should get an output looking like:
326+
The output should look like:
328327

329328
```output
330329
INFO Requesting key named 'skywalker' from the keybroker server with URL http://172.17.0.2:8088/keys/v1/key/skywalker
@@ -336,4 +335,5 @@ INFO Attestation success :-) ! The key returned from the keybroker is 'May the f
336335
```
337336

338337
Note that the interleaving of the trace messages and KBC messages might differ
339-
from one run to another.
338+
from one run to another. With the `switlb_bounced` messages above you can successfully observe that the bounce buffers are being used in the realm.
339+

content/learning-paths/servers-and-cloud-computing/cca-device-attach/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cascade:
77

88
minutes_to_complete: 90
99

10-
who_is_this_for: This Learning Path is for developers who want to learn about CCA Realms, VirtIO, Bounce Buffers and Device Attach.
10+
who_is_this_for: This is an advanced topic for developers who want to learn about Arm CCA Realms, VirtIO, Bounce Buffers and Device Attach.
1111

1212
learning_objectives:
1313
- Have a high level understanding of VirtIO and Bounce Buffers in CCA Realms

0 commit comments

Comments
 (0)