You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/cca-device-attach/2-virtio.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
-
title: "Device attach - part 1: virtio"
2
+
title: "Device attach: virtio"
3
3
weight: 2
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
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
10
10
relate to CCA Realms.
11
11
12
12
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
15
15
device attach.
16
16
17
-
As will be seen later in this learning path, more evolved device attach can be
17
+
More evolved device attach features can be
18
18
performed leveraging hardware security features like PCIe-TDISP (**T**EE
19
19
**D**evice **I**nterface **S**ecurity **P**rotocol) and PCIe-IDE (**I**ntegrity
20
20
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.
27
27
28
28
VirtIO is an abstraction layer for virtual devices in virtualized environments.
29
29
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
32
32
environment and can use optimized drivers (VirtIO) to communicate with virtual
33
33
hardware. Emulating hardware devices (like NICs or disks) for VMs is slow and
34
34
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:
45
45
46
46
### How VirtIO works in VMs
47
47
48
+
Here is an overview of how VirtIO works in Virtual Machines:
49
+
48
50
1. The Host Hypervisor (e.g., QEMU/KVM) exposes VirtIO “backend” devices.
49
51
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.
51
53
3. Communication happens via shared memory (`virtqueues`) for I/O operations,
52
54
avoiding full device emulation.
53
55
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.
60
62
61
63
### What are bounce buffers?
62
64
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:
67
66
1. The original buffer is not physically contiguous.
68
67
2. The buffer is in high memory or not accessible to the device.
69
68
3. The buffer doesn’t meet alignment or boundary requirements of the device.
70
69
71
-
### Why _bounce_ buffers?
70
+
### Why bounce buffers?
72
71
73
72
Data _bounces_ between:
74
73
- The original buffer (in user/kernel space) and
@@ -88,14 +87,14 @@ that:
88
87
- Even Direct Memory Access (DMA) from peripherals or untrusted drivers cannot
89
88
access Realm data.
90
89
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:
93
92
- Network stacks in the host OS,
94
93
- Storage subsystems,
95
94
- I/O devices managed by untrusted drivers?
96
95
97
96
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.
99
98
100
99
### How bounce buffers are used with RME
101
100
@@ -117,27 +116,27 @@ This pattern preserves confidentiality and integrity of Realm data, since:
117
116
118
117
### Confidentiality preserved with bounce buffers, really?
119
118
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
122
121
are nothing more than an explicitly shared temporary area between the Realm
123
122
world and the outside world. This does indeed preserve the confidentiality of
124
123
all the rest of the Realm data. On the other hand, for the data being
125
124
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.
127
126
128
127
## Seeing a Realm's bounce buffers at work
129
128
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
0 commit comments