Skip to content

Commit a8f166f

Browse files
Adjustments
1 parent f5d289a commit a8f166f

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

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

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,44 @@ layout: learningpathall
1010

1111
Bounce buffers are temporary memory areas used when a device cannot perform DMA on the original buffer.
1212

13-
Common reasons for this include:
13+
Common reasons include:
1414

15-
- The original buffer is not physically contiguous
16-
- The buffer resides in memory not accessible by the device
17-
- The buffer does not meet the device alignment or boundary constraints
15+
- The original buffer is not physically contiguous.
16+
- The buffer resides in memory not accessible by the device.
17+
- The buffer does not meet the device alignment or boundary constraints.
1818

1919
## Why use bounce buffers?
2020

21-
Data bounces between:
21+
Data *bounces* between:
2222

2323
- The original buffer in user space or kernel space
2424
- The DMA-capable bounce buffer used for device I/O
2525

26-
This indirection allows the transfer to proceed when the original buffer is unsuitable for DMA.
26+
This indirection allows data transfer to proceed when the original buffer is unsuitable for DMA.
2727

2828
## CCA Realms, VirtIO, and bounce buffers
2929

30-
A defining feature of a Realm is that its memory (Realm memory) is cryptographically isolated from both the Normal and Secure Worlds.
30+
A defining feature of a Realm is that its memory (Realm memory) is cryptographically isolated from both Normal Secure Worlds:
3131

3232
This means:
3333

34-
- Realm memory is encrypted with unique keys
35-
- Non-Realm entities (host OS, hypervisor) cannot directly read or
36-
write to Realm memory
37-
- Direct Memory Access (DMA) from peripherals or untrusted drivers cannot
38-
access Realm data
34+
- Realm memory is encrypted with unique keys.
35+
- The host OS and hypervisor cannot directly read or write Realm memory.
36+
- Direct Memory Access (DMA) from peripherals or untrusted drivers cannot access Realm data.
3937

40-
This design ensures confidentiality but presents a challenge: how can a Realm exchange data with untrusted components such as host network stacks or storage subsystems? The practical answer is to use bounce buffers as intermediaries - exchanging data securely with untrusted components (for example, network stacks, storage subsystems).
38+
This isolation ensures confidentiality but requires a secure way to exchange data with untrusted components such as host network stacks or storage subsystems. Bounce buffers provide this mechanism.
4139

42-
### How are bounce buffers used with RME?
40+
## How are bounce buffers used with RME?
4341

44-
Bounce buffers are used with RME to export and import data:
42+
With RME, Realms use bounce buffers to export and import data.
4543

46-
For exporting data:
44+
**Exporting data**:
4745
- A Realm application prepares data (for example, the results of computation)
4846
- It copies the data from protected Realm memory into a bounce buffer
4947
- The Realm notifies the untrusted host or hypervisor
5048
- The host retrieves the data from the bounce buffer
5149

52-
For importing Data:
50+
**Importing data**:
5351
- The host places data into a bounce buffer
5452
- The Realm is notified and validates the source
5553
- The Realm copies the data from the bounce buffer into protected memory
@@ -60,7 +58,7 @@ This pattern preserves confidentiality and integrity of Realm data because:
6058
- Incoming data can be validated and sanitized before import
6159
- Only data explicitly copied out leaves Realm protection
6260

63-
### Does a bounce buffer preserve confidentiality?
61+
## Does a bounce buffer preserve confidentiality?
6462

6563
A bounce buffer preserves the confidentiality of other Realm data because only the explicitly shared region is exposed. However, the transferred data is outside Realm protection once it leaves. Use protocol-level encryption such as TLS for network traffic to keep that data confidential in transit.
6664

content/learning-paths/servers-and-cloud-computing/cca-device-attach/4.lab-observe-bounce-buffers.md

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

99
## See a Realm's bounce buffers in action
1010

11-
You will confirm bounce buffer usage using the Key Broker demo from the [CCA Essentials Learning Path](/learning-paths/servers-and-cloud-computing/cca-essentials/example/).
11+
In this exercise, you’ll run the CCA Key Broker demo inside a Realm and use kernel tracing to confirm that bounce buffers (SWIOTLB) are used for VirtIO network I/O. You will confirm bounce buffer usage using the Key Broker demo from the [CCA Essentials Learning Path](/learning-paths/servers-and-cloud-computing/cca-essentials/example/).
1212

13-
### Start the Key Broker Server (KBS)
13+
## Start the Key Broker server (KBS)
1414

15-
Pull the docker container image with the pre-built KBS, and run the container:
15+
Pull the Docker container image with the pre-built KBS, and run the container:
1616

1717
```bash
1818
docker pull armswdev/cca-learning-path:cca-key-broker-v2
@@ -54,12 +54,12 @@ INFO Actix runtime found; starting in Actix runtime
5454
INFO starting service: "actix-web-service-172.17.0.2:8088", workers: 16, listening on: 172.17.0.2:8088
5555
```
5656

57-
### Get into a Realm
57+
## Get into a Realm guest
5858

5959
With the Key Broker Server running in one terminal, open up a new terminal in
6060
which you will run the Key Broker Client (KBC). The intent is to confirm that the data transmitted over the network (through `virtio_net`) are indeed using bounce buffers.
6161

62-
Pull the docker container image with the pre-built KBC, and then run the container:
62+
Pull the Docker container image with the pre-built KBC, and then run the container:
6363

6464
```bash
6565
docker pull armswdev/cca-learning-path:cca-simulation-v2
@@ -102,7 +102,7 @@ cd /cca
102102

103103
You should see the realm boot. Note that `lkvm` is invoked with `--network mode=user`, which makes the guest see the network through a VirtIO device.
104104

105-
After boot up, which might take some time, you will be prompted to log in at the guest Linux prompt. Use root again as the username:
105+
After boot, which might take some time, you will be prompted to log in at the guest Linux prompt. Use root again as the username:
106106

107107
```output
108108
Starting syslogd: OK
@@ -121,7 +121,7 @@ realm login: root
121121
(realm) #
122122
```
123123

124-
### Observe bounce buffer usage in the Realm
124+
## Observe bounce buffer usage in the Realm
125125

126126
Confirm that kernel tracing is available:
127127

@@ -185,7 +185,7 @@ grep keybroker-app- /sys/kernel/debug/tracing/trace_pipe &
185185
keybroker-app -v --endpoint http://172.17.0.2:8088 skywalker
186186
```
187187

188-
In the `keybroker-app`command above, `skywalker` is the key name that is requested from the KBS.
188+
In the `keybroker-app` command above, `skywalker` is the key name that is requested from the KBS.
189189

190190
The output should look like:
191191

0 commit comments

Comments
 (0)